代码:
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(); } } }