static void Main(string[] args) { Console.WriteLine("请输入想要多少道题?"); int n = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("开始生成题目..."); string content = ""; calculate cal = new calculate(n); cal.generateNum(); cal.Lines.ForEach(t => { writeToFile(t.ToString()); }); Console.WriteLine(content); Console.WriteLine("生成完毕"); Console.ReadKey(); }
static void Main(string[] args) { ConsoleKeyInfo cki; do { calculate cal = new calculate(); cal.inputManager(); Console.WriteLine("press any key to continue or press Esc button to exit"); cki = Console.ReadKey(true); if (cki.Key == ConsoleKey.Escape) { break; } else { Console.Clear(); continue; } }while(true); }