int a,b;
char ch;
printf("请输入一个虱子;
");
scanf("%d %c %d",&a,&ch,&b);
if(ch=='+')
printf("a+b=%d",a+b);
else if(ch=='-')
printf("a-b=%d",a-b);
else if(ch=='');
printf("ab=%d",a*b);
else if(ch=='/')
printf("a/b=%d",a/b);
return 0;
错误:忘了*,第三个if后面加了;,引以为戒!