赞
踩
int[] arrayInt = new int[] {4, 5, 2, 7, 9};
Console.WriteLine(arrayInt[3]);
foreach (Type in Collection) {}
int[] arrayInt = new int[] {4, 5, 2, 7, 9};
foreach (int temp in arrayInt)
{
Console.WriteLine(temp);
}
// 运行结果:
>>>4
>>>5
>>>2
>>>7
>>>9
for (int temp = 0; temp < arrayInt.Length; temp++)
{
Console.WriteLine(arrayInt[temp]);
}
// 运行结果:
>>>4
>>>5
>>>2
>>>7
>>>9
int[] arrayInt = new int[] {4, 5, 2, 7, 9};
int temp = 0;
while (true)
{
Console.WriteLine(arrayInt[temp]);
if (temp > arrayInt.Length)
{
break;
}
else
{
temp ++;
}
}
// 运行结果:
>>>4
>>>5
>>>2
>>>7
>>>9
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。