有下面一段代码:
do
{
myChoice = om.getChoice();
// Make a decision based on the user's choice
switch (myChoice)
{
case "A":
case "a":
Console.WriteLine("You wish to add an address.");
break;
case "D":
case "d":
Console.WriteLine("You wish to delete an address.");
break;
case "M":
case "m":
Console.WriteLine("You wish to modify an address.");
break;
case "V":
case "v":
Console.WriteLine("You wish to view the address list.");
break;
case "Q":
case "q":
Console.WriteLine("Bye.");
break;
default:
Console.WriteLine("{0} is not a valid choice", myChoice);
}
结果却显示:错误 CS0163: 控制不能从一个 case 标签(“default:”)贯穿到另一个 case 标签 |