首页 > 其他 > 详细

第十二章:while循环语句

时间:2020-06-05 20:50:17      阅读:29      评论:0      收藏:0      [点我收藏+]

代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace while循环语句
{
    /// <summary>
    /// while循环语句:循环的意思就重复的意思
    /// 
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //打印1-9到屏幕上
            int num = 1;

            while (num<=9)
            {
                Console.WriteLine(num);
                num = num + 1;//自增一
                //num++;一元运行符
                //num--;
            }
            Console.Read();
        }
    }
}

 

第十二章:while循环语句

原文:https://www.cnblogs.com/wangqiangya/p/13051412.html

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