大家帮忙看一下错在那里了,提示"控制不能从一个case标签<"default">贯串于另一个case标签"给分啦!!!
using System;
namespace doloop
{ public class doloop
{
public static void Main()
{
string myChoice;
{
do 
{   
//print a Menu
Console.WriteLine("My Address Book\n");
Console.WriteLine("A-Add New Address");
Console.WriteLine("D-Delete Address");
Console.WriteLine("M-Modify Address");
Console.WriteLine("V-View Address");
Console.WriteLine("Q-Quit\n");
Console.WriteLine("Choice(A,D,M,V or Q):");
//Retrieve the user'choice
myChoice=Console.ReadLine();
//Make a decision on 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);
}
//Pause to allow the user to see the the results
Console.WriteLine("Press any key to continue..");
Console.ReadLine();
Console.WriteLine();
}
while(myChoice!="Q" && myChoice!="q");//Keep going until the user wants to quit
}
} }
}