目前我有以下方法:
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Please enter magical number");
string input = "";
int number = int.Parse(Console.ReadLine());
if(number > 0){
for (int i = 1; i <= number; i++)
{
Console.Write("{0}, ", i);
}
Console.WriteLine("Pick another number");
input = Console.ReadLine();
} else {
Console.WriteLine("Wow that number is too low for me!");
}
}
}
在第一次运行时,一切都按预期工作,但是当用户输入新编号时,方法停止。我该如何防止这种情况?我做错了什么?
繁花如伊
慕哥6287543
相关分类