主题:帮忙这个是怎么错呀
using System;
class ifselect
{
public static void Main()
{
string ddr;
do
{
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 address");
Console.WriteLine("ddr(A,D,M,VorQ):");
ddr = Console.ReadLine();
switch (ddr)
{
case "a":
case "A": Console.WriteLine("You wish to add an address");
break;
case "d":
case "D": Console.WriteLine("You wish to delete address");
break;
case "m":
case "M": Console.WriteLine("You wish to modify address");
break;
case "v":
case "V": Console.WriteLine("You wish to view address");
break;
case "q":
case "Q": Console.WriteLine("Bye ");
break;
default:
Console.WriteLine("{0} is not a chose", ddr);
}
Console.WriteLine("please any key to continue ...");
Console.ReadLine();
Console.WriteLine();
} while (ddr != "q" && ddr != "Q");
}
错误 1 控制不能从一个 case 标签(“default:”)贯穿到另一个 case 标签 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 34 17 lianxi
class ifselect
{
public static void Main()
{
string ddr;
do
{
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 address");
Console.WriteLine("ddr(A,D,M,VorQ):");
ddr = Console.ReadLine();
switch (ddr)
{
case "a":
case "A": Console.WriteLine("You wish to add an address");
break;
case "d":
case "D": Console.WriteLine("You wish to delete address");
break;
case "m":
case "M": Console.WriteLine("You wish to modify address");
break;
case "v":
case "V": Console.WriteLine("You wish to view address");
break;
case "q":
case "Q": Console.WriteLine("Bye ");
break;
default:
Console.WriteLine("{0} is not a chose", ddr);
}
Console.WriteLine("please any key to continue ...");
Console.ReadLine();
Console.WriteLine();
} while (ddr != "q" && ddr != "Q");
}
错误 1 控制不能从一个 case 标签(“default:”)贯穿到另一个 case 标签 C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\lianxi\lianxi\Program.cs 34 17 lianxi