-3
我想檢查用戶輸入是否爲元音。如果按下其他任何鍵,則應顯示錯誤。這是迄今爲止我所擁有的。我如何添加其他Keys? 電流輸出: 「鍵按下」 AC#檢查元音
static void Main(string[] args)
{
ConsoleKeyInfo A;
while (true)
{
A = Console.ReadKey();
if (A.Key == ConsoleKey.A);
{
Console.WriteLine("A");
}
}
}
這看起來像一個堅實的答案!雖然我得到的錯誤名稱'鑰匙'不存在於當前的情況下 – user3415389
@ user3446201我認爲我超出範圍,你可以告訴在哪裏放置此代碼? – user3415389