using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("Output the do{...} while() result"); int i = 1; do { Console.WriteLine("{0}",i++); } while(i<=10); Console.WriteLine("Output the while(){...} result"); int j = 1; while(j<=10) { Console.WriteLine("{0}",j++); } Console.WriteLine("Output for(;;) result"); int k = 1; for (k = 1; k <= 10; ++k) { Console.WriteLine("{0}",k); } Console.ReadLine(); } } }
时间: 2024-11-13 09:18:01