程序代码:while (i < 10)
{
try//try-catch
{
Console.WriteLine("请输入第{0}个正整数。", i);
shu = Convert.ToInt32(Console.ReadLine());
}
catch
{
Console.WriteLine("输入错误,请重新输入一个正整数。");
i = 1; //改成你的初始值
continue;
}
if (shu > a)
{
a = shu;
}
i++;
}




