• 利用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();
                }

  • 相关阅读:
    bug终结者 团队作业第二周
    dropdownlist绑定数据
    virtual与vmware
    后台控制输出table(有数据库)
    label 绑定数据
    flash不能显示中文
    dataset 多表查询
    MVC3 Razor视图引擎基础语法 [转]
    CreateAlias()与setFetchMode() [转 李丽芬]
    Linq Like [转 韩天伟]
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4372863.html
Copyright © 2020-2023  润新知