//while循环 class Program { static void Main(string[] args) { Console.WriteLine("请输入一个整数:"); int i = int.Parse(Console.ReadLine()); int j = 1; while (j < i) { Console.WriteLine(j); } } } //do while循环 class Program { static void Main(string[] args) { Console.WriteLine("请输入一个整数:"); int i = int.Parse(Console.ReadLine()); int j = 1; do { Console.WriteLine(j); } while (j < i); } }