问题 有点多, 打字很慢的, 你自己比较一下代码
#include<stdio.h>
int main()
{
int a = 0;
int b,c,d;
while(1)
{
printf("======================简易两数加减乘除计算器==========================\n\n\n");
printf("======================请选择运算方式==========================\n\n\n");
printf("1.加
2.减
3.乘
4.除
5.大小比较
6.退出\n\n");
scanf("%d",&a);
switch(a)
{
case 1:
printf("请输入加数b的值:\n");
scanf("%d",&b);
printf("请输入加数c的值:\n");
scanf("%d",&c);
d=b+c;
printf("加数的计算结果为:%d+%d=%d\n",b,c,d);
break;
case 2:
printf("请输入减数b的值:\n");
scanf("%d",&b);
printf("请输入减数c的值:\n");
scanf("%d",&c);
d=b-c;
printf("减数的计算结果为:%d-%d=%d\n",b,c,d);
break;
case 3:
printf("请输入乘数b的值:\n");
scanf("%d",&b);
printf("请输入乘数c的值:\n");
scanf("%d",&c);
d=b*c;
printf("积的计算结果为:%d*%d=%d\n",b,c,d);
break;
case 4:
printf("请输入除数b的值:\n");
scanf("%d",&b);
printf("请输入被除数c的值:\n");
scanf("%d",&c);
d=b/c;
printf("商的计算结果为:%d/%d=%d\n",b,c,d);
break;
case 5:
printf("请输入要比较数b的值:\n");
scanf("%d",&b);
printf("请输入要比较数c的值:\n");
scanf("%d",&c);
if(b > c)
{printf("%d > %d\n", b, c);}
if(b == c)
{printf("%d = %d\n", b, c);}
if(b < c)
{printf("%d < %d\n", b, c);}
break;
case 6:
goto _out;
default:
printf("您输入的数据有错误!请重新选择\n");
}
}
_out:
return 0;
}