//关于计算器四则运算
#include<stdio.h>
void main()
{
int a,b;
char c;
printf("input a(+,-,*,/)b:");
scanf("%d%c%d",&a,&c,&b);
switch(c)
{
case '+':printf("a+b=%d\n",a+b);break;
case '-':printf("a-b=%d\n",a-b);break;
case '*':printf("a*b=%d\n",a*b);break;
case '/':
loop:
if(b==0)
{
printf("变量b不能为0,请重新再输入!\n");break;
goto loop;
}
else
printf("a/b=%d\n",a/b);break;
default:printf("error!\nplese input again!\n");
}
printf("press any key to continue!\n");
getch();
}