c# - 使用 if-else 查找三个中最大的数。为什么它不想编译?

标签 c# if-statement

我是编程的初学者,我真的很想知道我在这里犯了什么错误:

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/

相关文章:

c# - c#中不同选项卡的不同类

C# 和 ASP.Net。需要指导

r - 查找一个字符串是否包含在 R 中的另一个字符串中

xml - XSLT-2.0 IF 语句/分组

javascript - 如何在 jQuery ui Slide Ranger 中使用 if 语句?

JAVA试图寻找年度最佳职位。不工作

C#从命令行运行窗体程序时隐藏窗体

c# - 在 WCF 中获取调用者的主机名

c# - CodePlex 和 CodeProject 的 QuickGraph 之间的区别

if-statement - = google 文档中的 IF 语法错误