Console.WriteLine("请输入第一个数");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("请输入第二个数");
int b = int.Parse(Console.ReadLine());
Console.WriteLine("请输入运算符'+','-','*','/'");
string c = Console.ReadLine();
if (c == "+")
{
int resount;
resount = a + b;
Console .WriteLine ("结果是{0}",resount );
}
else if (c == "-")
{
int resount;
resount = a - b;
Console.WriteLine("结果是{0}", resount);
}
else if (c == "*")
{
int resount;
resount = a * b;
Console.WriteLine("结果是{0}", resount);
}
else if (c == "/")
{
int resount;
resount = a / b;
Console.WriteLine("结果是{0}", resount);
}
else
{
Console.WriteLine("请输入有效的运算符");
}
Console.ReadKey();
自己去学一下c++的mfc吧,里面可以做这个,遇到不懂的地方来问我。
System.Diagnostics.Process.Start("calc.exe");