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

posted @ 2015-03-27 21:10  XCml  阅读(519)  评论(0编辑  收藏  举报