主题:一个简单问题,初学菜鸟请教
static void Main(string[] args)
{
jieguo jg=new jieguo(cff);
double a, b;
string s;
Console.WriteLine("输入a");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("输入b");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("输入要进行的运算:");
s=Console.ReadLine();
switch (s)
{
case "*":
jg = new jieguo(cff);
//s = "8";
break;
case "/":
jg = new jieguo(ccf);
break;
default:
Console.WriteLine("输入符号有误");
//Console.ReadKey();
//break;
goto end; 《《《《这里不执行break对后面编程有没有影响?
}
Console.WriteLine("{0}+{1}={2}",a,b,jg(a,b));
end:
Console.ReadKey();
{
jieguo jg=new jieguo(cff);
double a, b;
string s;
Console.WriteLine("输入a");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("输入b");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("输入要进行的运算:");
s=Console.ReadLine();
switch (s)
{
case "*":
jg = new jieguo(cff);
//s = "8";
break;
case "/":
jg = new jieguo(ccf);
break;
default:
Console.WriteLine("输入符号有误");
//Console.ReadKey();
//break;
goto end; 《《《《这里不执行break对后面编程有没有影响?
}
Console.WriteLine("{0}+{1}={2}",a,b,jg(a,b));
end:
Console.ReadKey();