zoukankan      html  css  js  c++  java
  • 4个数比大小

    while (true)
    {
    int a, b, c, d;
    Console.WriteLine("请输入第1个数:");
    a = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("请输入第2个数:");
    b = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("请输入第3个数:");
    c = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("请输入第4个数:");
    d= Convert.ToInt32(Console.ReadLine());

    if(a>=b&&a>=c&&a>=d)
    {
    Console.WriteLine(a+"最大");
    }
    else if (b >= a && b >= c&&b>=d)
    {
    Console.WriteLine(b+"最大");
    }
    else if (c >= a && c >= b&&c>=d)
    {
    Console.WriteLine(c+"最大");
    }
    else if (d >= a && d >= b && d >= c)
    {
    Console.WriteLine(d + "最大");
    }
    else
    {
    Console.WriteLine("1");

  • 相关阅读:
    爬虫入门
    读写文件操作
    列表的操作
    课后习题小练
    Python切片
    逗号的麻烦
    字符串学与练
    Turtle的学习
    FTL(FreeMarker)基础
    java反射机制基础
  • 原文地址:https://www.cnblogs.com/g-pf/p/4378074.html
Copyright © 2011-2022 走看看