标签:
//for循环
int[] nums = {1,2,3,4,5,6,8,7,9,10 };
for (int i = 0; i < nums.Length;i++ )
{
Console.WriteLine(nums[i]);
}
Console.ReadKey();
//foreach循环
int[] nums = { 1, 2, 3, 4, 5, 6, 8, 7, 9, 10 };
foreach (var item in nums)
{
Console.WriteLine(item);
}
Console.ReadKey();
标签:
原文地址:http://www.cnblogs.com/swlq/p/5392908.html