string confirm = "";
while (confirm != "y" || confirm != "n")
{
Console.Write("Remove {0}' account? (Y/N): ", Accounts[accountNumber].Name);
confirm = Console.ReadLine();
confirm = confirm.ToLower();
}
由于某些未知原因,我的循环检查失败。即使确认IS是“n”还是“y”,它仍会再次循环。我甚至通过使用断点检查它是否与“n”或“y”匹配。那么,为什么每次都会失败?为什么这个循环永远?
你的意思是它总是在循环中,或者它永远不会在循环中? –