static void Main(string[] arg) { int intSum = 0; for (int i = 0; i <= 100; i++) { intSum += i; } Console.WriteLine(intSum); Console.ReadKey(); }
static void Main(string[] arg) { for (int i = 0; i < 100; i++) { Console.WriteLine("我下次一定小心!");//打印"我下次一定小心" } Console.ReadKey(); }
static void Main(string[] arg) { int sum = 0; for (int i = 0; i < 100; i++) { if (i%2==0) { sum += i; } } Console.WriteLine(sum); Console.ReadKey(); }
标签:Console,string,int,void,练习,循环,static,arg From: https://www.cnblogs.com/csflyw/p/18354715