zoukankan      html  css  js  c++  java
  • 语句

     Console.WriteLine("你能跑的过豹子吗?(能?不能)");

             string a =Console.ReadLine();

                if(a=="能")

                {

               Console.WriteLine("你比禽兽还禽兽");

                }

     

               else if (a == "不能")

                {

                    Console.WriteLine("你连禽兽都不如");

                }

                else

                {

                    Console.WriteLine("输入有误!");

                }

                Console.ReadLine();

    //判断输入的内容是(能)或者(不能) 还是其他

                //if() {} elseif(){} ....else{}

            }Console.Write("请输入x=");

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

                Console.Write("请输入Y=");

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

               if (x >= Y)

                {

                    Console.WriteLine(x + "    " + Y);

                }

                else

                {

                    int zhong;//利用中间变量,将两个变量的值 进行互换

                    zhong = x;

                    x = Y;

                    Y = zhong;

                    Console.WriteLine(Y+""+x);

                }

                Console.ReadLine();

     

    Console.Write("请输入x=");

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

                Console.Write("请输入Y=");

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

                Console.Write("请输入z=");

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

                if (x < Y && x < z)

                {

                    Console.WriteLine(x);

                    if (Y < z)

                    {

                        Console.WriteLine(Y); Console.WriteLine(z);

                    }

                    else

                    {

                        Console.WriteLine(z); Console.WriteLine(Y);

                    }

                }

     

                if (Y < x && Y < z)

                {

                    {

                        Console.WriteLine(Y);

                    }

                    if (x < z)

                    {

                        Console.WriteLine(x); Console.WriteLine(z);

                    }

                    else

                    {

                        Console.WriteLine(z); Console.WriteLine(x);

     

                    }

                }

                if (z < x && z < Y)

                {

                    {

                        Console.WriteLine(z);

                    }

                    if (x < Y)

                    {

                        Console.WriteLine(x); Console.WriteLine(Y);

                    }

                    else

                    {

                        Console.WriteLine(Y); Console.WriteLine(x);

     

                    }

                }

    Console.WriteLine("输入一个小于等于100的整数:");

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

                if (a <= 100)//先保证输入的数是小于等于100

     

     

                {

                    if (a < 10)//先排除小于十的

                    {

                        Console.WriteLine("这是个小于10的整数");

                    }

                    else//剩下10-100

                    {

                        if (a == 100)

                        {

                            Console.WriteLine("这个数是100!");

     

                        }

                        else//剩下的就是10-99

                        {

                            Console.WriteLine("这个数是两位数");

                        }

      Console.Write("输入学生姓名:");

                string name = Console.ReadLine();

                Console.Write("输入考试成绩:");

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

                if(a<=100&&a>0)

                {

                if (a == 100)//排除掉100

                {

                    Console.WriteLine("恭喜," + name + "满分通过");

                }

                else//剩下0-99

                {

                    if (a >= 80)//排除90-80的

                    {

                        Console.WriteLine("" + name + "你很优秀,请继续保持");

                    }

                    else//剩下0-79的

                    {

                        if (a >= 60)//排除60以上的

                            Console.WriteLine("" + name + "成绩良好");

     

     

     

                        else

                        {

                            if (a >= 50)//排除50以上的

                            {

                                Console.WriteLine(name + "就差一点点,下次一定要及格");

                            }

                            else//剩下0-49的

                            {

                                Console.WriteLine(name + "你是笨蛋吗?");

                            }

                        }

                    }

     

     

        

    onsole.Write("请输入一个数:");

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

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

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

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

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

               int zhong;

                if(x>y)

                {

                    zhong =x;

                    x=y;

                        y=zhong;

                }

                if(x>z)

                {

     

                    zhong=x;

                    x=z;

                    z=zhong;

     

                }

                   if(y>z)

                   {

                   zhong =y;

                       y=z;

                       z=zhong;

                   }

                    Console.Write(x+"" +y+""+z);

                }

            

  • 相关阅读:
    [Windows Powershell]-学习笔记(1)
    MyBatis For .NET学习-问题总结
    Zynq学习笔记(1)
    规范的位操作方法
    浮点数转换成字符串函数
    测试卡尔曼滤波器(Kalman Filter)
    关于按键扫描程序的终极讨论
    关于STM8的用户数据空间读写问题
    IPv4分析
    关于STM8空间不足的解决方法
  • 原文地址:https://www.cnblogs.com/yuyingming/p/4921042.html
Copyright © 2011-2022 走看看