static void Main(string[] args)
{
int a = 0, b = 0, c = 0, max = 0;
try
{
Console.WriteLine("请输入第一个数字:");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入第二个数字:");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入第三个数字");
c = Convert.ToInt32(Console.ReadLine());
}catch(Exception e)
{
Console.WriteLine("输入的不是数字!");
return;
}
if (a > b)
max = a;
else
max = b;
if (max < c)
{
max = c;
}
Console.WriteLine("最大数字是:" + max.ToString());
}
if(a>b && a>c)
console.writeline(a);
else if(b>a && b>c)
console.writeline(b);
else
console.writeline(c);
//以上是核心代码,前面用三个变量a,b,c接收下。
PS.