【发布时间】:2017-04-11 06:15:20
【问题描述】:
使用系统;
namespace Loop
{
class Program
{
static void Main(string[] args)
{
int[] Numbers = new int[3];
Numbers[0] = 101;
Numbers[1] = 102;
Numbers[2] = 103;
int i = 0;
while (i < Numbers.Length)
{
Console.WriteLine("Numbers are: "+ Numbers[i]);
i++;
Console.ReadKey();
}
}
}
}
【问题讨论】:
-
Console.ReadKey();- 只需按下它 -
这里等待用户输入 Console.ReadKey();
-
在它打印了 101 之后你按下了一个键吗?它对我来说很好......
-
将
Console.ReadKey()放在while循环之后。简单的调试会告诉你,当你点击这个语句时,控制台会弹出,因为它需要你的键输入。
标签: c# loops while-loop