//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();