int a, b;
do
{
Console.Write("请输入第一个整数a:");
} while (!int.TryParse(Console.ReadLine(), out a));
do
{
Console.Write("请输入第二个整数b:");
} while (!int.TryParse(Console.ReadLine(), out b));
Console.WriteLine("a+b=" + (a + b).ToString());
Console.WriteLine("a-b=" + (a - b).ToString());
Console.WriteLine("a*b=" + (a * b).ToString());
if (b == 0)
{ Console.WriteLine("因除数b为0,无法进行除法运算!"); }
else
{ Console.WriteLine("a/b=" + float.Parse(a.ToString()) /float.Parse ( b.ToString())); }
Console.ReadLine();