涉及知识点:int、WriteLine、ReadLine、TryParse、while循环
int num;
Console.WriteLine("请输入整型数据!,您输入的是:");
string Ke = Console.ReadLine();
while (!int.TryParse(Ke, out num))
{
Console.WriteLine("哎呀呀!你输入不是整型数据,请重新输入");
Ke = Console.ReadLine();
}
涉及知识点:int、WriteLine、ReadLine、TryParse、while循环
int num;
Console.WriteLine("请输入整型数据!,您输入的是:");
string Ke = Console.ReadLine();
while (!int.TryParse(Ke, out num))
{
Console.WriteLine("哎呀呀!你输入不是整型数据,请重新输入");
Ke = Console.ReadLine();
}