解析 int a=10;int b=20;int c;string operation = ""; //加减乘除switch(operation){case "+": c=a+b; break;case "-": c=a-b; break;case "*": c=a*b; break;case "/": c=a/b; break;default: c=0; break;} 反馈 收藏 ...
解答一 举报 int a=10;int b=20;int c;string operation = ""; //加减乘除switch(operation){case "+": c=a+b; break;case "-": c=a-b; break;case "*": c=a*b; break;case "/": c=a/b; break;default: c=0; break;} 解析看不懂?免费查看同类题视频解析查看解答 ...
解答一 举报 int a=10;int b=20;int c;string operation = ""; //加减乘除switch(operation){case "+": c=a+b; break;case "-": c=a-b; break;case "*": c=a*b; break;case "/": c=a/b; break;default: c=0; break;} 解析看不懂?免费查看同类题视频解析查看解答 ...
【简答题】试编程实现: 利用switch语句实现“加减乘除四则运算”:即从键盘输入运算数和运算符(+或-或*或/)输出计算结果,如从键盘输入2+3,程序运行后输出2+3=5,若输入2*3,则输出结果2*3=6。 请将程序代码和运行结果一起截图保存成名为:(班级+学号+姓名+编程题2.jpg)图片,然后直接插入该图片到提交框中,...
{ double a,b;char c;scanf("%f %c %f",&a,&c,&b);printf("%f%c%f=",a,c,b);switch(...
void main(){ float num1,num2;char ch;printf("请输入运算符(+-*/):");scanf("%c",&ch);printf("请输入第一个数字:");scanf("%f",&num1);printf("请输入第二个数字:");scanf("%f",&num2);switch(ch){ case '+':printf("%f+%f=%f\n",num1,num2,num1+num2);break;cas...
int main(){ int num1,num2,num3=0;char a;while(1){ printf("input:");scanf("%d%c%d",&num1,&a,&num2);/ switch(a){ case '+':num3 = num1+num2;break;case '-':num3 = num1-num2;break;case '*':num3 = num1*num2;break;case '/':num3 = num1/num2;break...
解析 int a=10;int b=20;int c;string operation = ""; //加减乘除switch(operation){case "+": c=a+b; break;case "-": c=a-b; break;case "*": c=a*b; break;case "/": c=a/b; break;default: c=0; break;}结果一 题目 C#中怎样运用switch 语句计算加减乘除运算 答案 int a=10...