直接访问数组每一个数
1 using System; 2 namespace ArrayApplication 3 { 4 class MyArray 5 { 6 static void Main(string[] args) 7 { 8 int[] n = new int[10]; 9 int i; 10 for(i=0;i<10;i++) 11 { 12 n[i] = i + 100; 13 } 14 foreach(int j in n) 15 { 16 17 Console.WriteLine("{0}", j); 18 19 } 20 Console.ReadKey(); 21 22 23 } 24 } 25 }
原文:https://www.cnblogs.com/welasss/p/15302875.html