程序出错?求高手给看看?
using System;class Test18{
public static void Main(){
string myInput;
int myInt;
begin:
Console.Write("Please enter a number between 1 and 3:");
myInput=Console.ReadLine();
myInt=Int32.Parse(myInput);
switch(myInt){
case 1:
Console.WriteLine("Your number is {0}.",myInt);
break;
case 2:
Console.WriteLine("Your number is {0}.",myInt);
break;
case 3:
Console.WriteLine("Your number is {0}",myInt);
break;
default:
Console.WriteLine("Your number {0} is not between 1 and 3.",myInt);
}
decide:
Console.Write("Type \"continue\" to go on or \"quit\" to stop:");
myInput=Console.ReadLine();
switch(myInput){
case "continue":
goto begin;
case "quit":
Console.WriteLine("Bye.");
break;
default:
Console.WriteLine("Your input {0} is incorrect.",myInput);
goto decide;
}
}
}
红色标记下面一定要加break?