标签:break include else printf error com info ima clu
```#include<stdio.h>
int main()
{
int a, b, c, count = 0;
char ch;
scanf("%d", &a);
while ((ch = getchar()) != ‘=‘)
{
scanf("%d", &b);
if ((ch == ‘/‘) && (b == 0))
{
count = 1; break;
}
switch (ch)
{
case ‘+‘: a = a + b; break;
case ‘-‘:a = a - b; break;
case ‘*‘:a = a * b; break;
case ‘/‘:a = a / b; break;
default:
count = 1; break;
}
if (count) break;
}
if (count)
{
printf("ERROR");
}
else
{
printf("%d", a);
}
return 0;
}
标签:break include else printf error com info ima clu
原文地址:https://blog.51cto.com/14737345/2479856