首页 > 其他 > 详细

梯数得分循环

时间:2015-03-31 19:59:24      阅读:155      评论:0      收藏:0      [点我收藏+]

{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int sum = 0;
                for (int i = 1; i <= 100; i++)
                {
                    if (i == 70)
                    {
                        Console.WriteLine("跌倒了");
                    }
              
                    if (i<= 49)
                    {
                        sum = sum + i;
                        Console.WriteLine("您"+i+"层的得分为"+sum);
                      
                    }
                    else if (i > 49 && a <= 100)
                    {
                        sum = sum + 10;
                        Console.WriteLine(("您"+i+"层的得分为"+sum));
                    }
                    else
                    {
                        Console.WriteLine("出错");
                    }
                    Thread.Sleep(1000);//延时一秒
                }
              
 
                Console.ReadLine();

梯数得分循环

原文:http://www.cnblogs.com/lk-kk/p/4381758.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!