我試圖解決這個代碼,所以它重複異常,直到輸入是一個數字。現在它停止正確的第一次嘗試,我知道如何放置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」+感興趣的關鍵字。 –