zoukankan      html  css  js  c++  java
  • 利用if else判断是否及格


            static void Main(string[] args)
            {
                while (true)
                {
                    string a; int b;
                    Console.Write("请输入您的姓名:");
                    a = Console.ReadLine();
                    Console.Write("请输入您的分数:");
                    b = Convert.ToInt32(Console.ReadLine());
                    if (b >60 &&b<100)
                    {
                        Console.WriteLine("恭喜你,及格了");
                        if (b > 80)
                        {
                            Console.WriteLine("你学的不错,值得表扬");
                        }
                        else
                        {
                            Console.WriteLine("刚刚及格,不要骄傲");
                        }
                    }

                    else if (b > 50 && b < 60)
                    {
                        Console.WriteLine("就差一点点,在加把劲");
                    }
                    else if(b>0&&b<50)
                    {
                        Console.WriteLine("使劲努力,不要偷懒");

                    }
                    else
                    {
                        Console.WriteLine("请输入正确的分数");
                    }
                   
                   
                   
                   
                   
                   
                   
                    Console.ReadLine();
                }

  • 相关阅读:
    相关正则的一些知识
    数组中的方法
    封装ajax
    swiper结合ajax的轮播图
    事件
    原型、原型链
    HTML 常用标签
    HTML基础了解
    JSON 与 XML基本了解
    JavaScript(js)
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4372863.html
Copyright © 2011-2022 走看看