为什么这个Simple For Loop不起作用?

Wil*_*ang 0 c# for-loop

任何人都可以告诉我为什么这个简单的for循环不起作用?例如,如果我键入5,则不会出现任何内容.

int Num2 = Convert.ToInt32(Console.ReadLine());

for (int i = Num2; i < 1; i--) {
    Console.WriteLine("Test{0}", i);
}
Run Code Online (Sandbox Code Playgroud)

Joh*_*ohn 6

你的病情是"我小于1".你可能意味着"我大于零".

for (int i = Num2; i > 0; i--)
Run Code Online (Sandbox Code Playgroud)

  • 我知道了!非常感谢! (2认同)