LEATH
Console.WriteLine("请输入一个整数:");string input = Console.ReadLine();int num;while (true){try{num = int.Parse(input);if (num % 2 == 0){Console.WriteLine("您输入的是偶数。");break;}else{Console.WriteLine("您输入的是奇数。");break;}}catch{Console.WriteLine("输入错误请重新输入:");input = Console.ReadLine();}}