int main()
{
int a;
char b;
int c;
int result = 0;
printf(“请输入算术表达式:\n”);
scanf("%d%c%d",&a,&b,&c);
switch (b)
{
case ‘+’: result = a + c; printf("%d", result); break;
case ‘-’: result = a - c; printf("%d", result); break;
case ‘*’: result = a * c; printf("%d", result); break;
case ‘/’: result = a / c; printf("%d", result); break;
default:printf(“出现错误:\n”); break;
}
return 0;
}