C# FOR循环

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6.   
  7. namespace _03for循环  
  8. {  
  9.     class Program  
  10.     {  
  11.         static void Main(string[] args)  
  12.         {  
  13.             //向控制台打印10遍  欢迎来到传智播客.Net学习  
  14.   
  15.             for (int i = 0; i < 10; i++)  
  16.             {  
  17.                 Console.WriteLine("欢迎来到传智播客.Net学习{0}", i);  
  18.             }  
  19.             //for (int i = 0; i < length; i++)  
  20.             //{  
  21.                   
  22.             //}  
  23.             Console.ReadKey();  
  24.   
  25.             //int i = 0;//定义循环的次数  
  26.             //while (i < 10)  
  27.             //{  
  28.             //    Console.WriteLine("欢迎来到传智播客.Net学习");  
  29.             //    i++;  
  30.             //}  
  31.             //Console.ReadKey();  
  32.         }  
  33.     }  
  34. }  
shashou47

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: