我在創建將請求用戶輸入的循環時遇到問題,並且如果輸入不是「Y」或「N」來重新提示用戶輸入一遍又一遍,直到他們給出正確的輸入。嘗試使退出序列僅在正確輸入時纔會執行
while (quitOrContinue != "Y"|"N")//cant use "Y"/"N" in the same line, how do I phrase this line?
Console.Write("\nWould you like to process another set of bowling scores?");
Console.WriteLine("\nPress 'Y' to process another set or 'N' to exit the program");
Console.Clear();// this needs to happen if the input to run again is "Y"
我沒有看到任何循環代碼在你的問題.... – Tim 2014-11-01 23:43:36