这个用c语言写的,哪里错了,怎么改?求解答!

int main()
{
int a,b;
char c;
scanf("%d %c %d", &a, &c, &b);
if(c=='+')
printf("%d",a+b);
if(c=='-')
printf("%d",a-b);
if(c=='')
printf("%d",a
b);
if(c=='/'&&b!=0)
printf("%d",a/b);
if(c=='%'&&b!=0)
printf("%d",a%b);
else
printf("ERROR");
return 0;
}

img

第1 ab是无法识别的,在程序里面乘法只能用a*b;
第2点 是个建议 用if ,else if 和else 不然你这个 如果不是'%'&&b!=0都会输出结果并且输出ERROR
用switch也可以