码迷,mamicode.com
首页 > 其他好文 > 详细

烧开水循环

时间:2015-03-31 20:01:40      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

namespace 烧开水循环跳转
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Clear();
            while (true)
            {
               
                string x;
               
               
                Console.WriteLine("请问您是否要烧开水(Y/N)");
                x = Console.ReadLine();
                if (x == "Y")
                {
                    for (int i = 1; i <= 100; i++)
                    {
                       
                        Console.WriteLine("当前温度为"+i+"℃");
                           
                      
                       if (i == 30)
                        {
                            Console.WriteLine(i + "℃" + "水温了");
                        }
                      
                        else if (i == 50)
                        {
                            Console.WriteLine(i + "℃" + "水热了");
                        }
                      
                        else if (i == 80)
                        {
                            Console.WriteLine(i + "℃" + "水快开了");
                        }
                       
                        else if (i == 100)
                        {
                            Console.WriteLine(i + "℃" + "水开了");
                         
                        }

                      
                  }

                }
                else if (x == "N")
                {
                    Console.WriteLine("不喝水,渴死你丫的!");
                }
                else
                {
                    Console.WriteLine("有病吧你!!");
                }

 

 

 

 

 

                Console.ReadLine();
            }
        }
    }
}

烧开水循环

标签:

原文地址:http://www.cnblogs.com/lk-kk/p/4381761.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!