在C#中用if语句编写计算器,但是要怎么把if语句换成switch语句?
C#?
swith(opr){ case "+": //yourcode break; case "-": //yourcode break; case "*": //yourcode break; case "/": //yourcode break; }
swith直接代替if