using System;public class test
{
static void Main()
{
int a,b;
int c;
        Console.WriteLine("请输入2个数字");
a=Convert.ToInt32(Console.ReadLine());
b=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请选择运算符:1.加 2.减 3.乘 4.除");
c=Convert.ToInt32(Console.ReadLine());
switch(c)
{
case 1:
Console.WriteLine("第一个数加第二个数的和是:{0}",a+b);
break;
case 2:
Console.WriteLine("第一个数减第二个数是:{0}",a-b);
break;
case 3:
Console.WriteLine("第一个数乘第二个数是:{0}",a*b);
break;
case 4:
if(a==0|b==0)
{
Console.WriteLine("除数不能为0!");
break;
}
Console.WriteLine("第一个数除第二个数是:{0}",a/b);
break;
default:
if(c>4)
{
Console.WriteLine("不要乱按!");
break;
}
break;
}
}
}
问题在这里
default:
if(c>4)
{
Console.WriteLine("不要乱按!");
break;
}
break;如何判断C的值是否为其他类型不为INT型?