• 输入三个数,从大到小排列


    //输入3个数,将这三个数从大到小排列打印出来;

                Console.Write("请输入第一个数字:");

                int a = int.Parse(Console.ReadLine());

                Console.Write("请输入第一个数字:");

                int b = int.Parse(Console.ReadLine());

                Console.Write("请输入第一个数字:");

                int c = int.Parse(Console.ReadLine());

                if(a>=b&&a>=c)

                {

                   if(b>=c)

                   {

                       Console.WriteLine(a);

                       Console.WriteLine(b);

                       Console.WriteLine(c);

                   }

                    else

                   {

                       Console.WriteLine(a);

                       Console.WriteLine(c);

                       Console.WriteLine(b);

                   }

                }

                if (b >= a && b>= c)

                {

                    if (a >= c)

                    {

                        Console.WriteLine(b);

                        Console.WriteLine(a);

                        Console.WriteLine(c);

                    }

                    else

                    {

                        Console.WriteLine(b);

                        Console.WriteLine(c);

                        Console.WriteLine(a);

                    }

                }

                if (c >= a && a >= b)

                {

                    if (a >= b)

                    {

                        Console.WriteLine(c);

                        Console.WriteLine(a);

                        Console.WriteLine(b);

                    }

                    else

                    {

                        Console.WriteLine(c);

                        Console.WriteLine(b);

                        Console.WriteLine(a);

                    }

                }

                Console.ReadLine();

  • 相关阅读:
    第一次作业
    机器学习第一次个人作业
    第02组 Beta版本演示
    第02组 Beta冲刺(4/4)
    第02组 Beta冲刺(3/4)
    微信小程序信息会话列表删除功能
    微信小程序自定义弹窗组件
    微信小程序使用Echarts
    uni.showModal,uni.showToast使用
    Array filter() 方法
  • 原文地址:https://www.cnblogs.com/fengsantianya/p/5456551.html
Copyright © 2020-2023  润新知