我试图解决这个代码,所以它重复异常,直到输入是一个数字。现在它停止正确的第一次尝试,我知道如何放置while循环。数值输入异常
int nomer2;
WriteLine("Write Number");
try
{
nomer2 = Convert.ToInt32(ReadLine());
WriteLine("here is my Number {0}", nomer2);
}
catch (Exception)
{
WriteLine("Error: Enter Number");
}
通过在stackoverflow上提出问题,您无法一次学习一个语言关键字。我会建议参加编程课程,或者打开一本书,或者搜索“C#sample”+感兴趣的关键字。 –