我是编程的初学者,我真的很想知道我在这里犯了什么错误:
static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
if ((a > b) && (a > c))
{
Console.WriteLine(a);
}
else
{
if ((b > a) && (b > c)) ;
{
Console.WriteLine(b);
}
else
{
Console.WriteLine(c);
}
}
}
最佳答案
if ((b > a) && (b > c)) ;
删除;
关于c# - 使用 if-else 查找三个中最大的数。为什么它不想编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13847256/