手机编译出了一大串错误,请大家指教
如下代码#include <stdio.h>#include <stdlib.h>
int main(void)
{
int i=0,a,b,c,n;
char ch;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %c %d",&a,&ch,&b);
switch(ch)
{
case '+':{c=a+b;printf("%d\n",c);break;}
case '-':{c=a-b;printf("%d\n",c);break;}
case '*':{c=a*b;printf("%d\n",c);break;}
case '/':{c=a/b;printf("%d\n",c);break;}
}
}
return 0;
}
Compiling your program...
prog.c: In function 'main':
prog.c:13:9: error: stray '\357' in program
case '+':{c=a+b;printf("%d\n",c);break;}
^
prog.c:13:9: error: stray '\274' in program
prog.c:13:9: error: stray '\232' in program
prog.c:13:20: error: expected ':' or '...' before '{' token
case '+':{c=a+b;printf("%d\n",c);break;}
^
prog.c:15:10: error: stray '\357' in program
case '-':{c=a-b;printf("%d\n",c);break;}
^
prog.c:15:10: error: stray '\274' in program
prog.c:15:10: error: stray '\232' in program
prog.c:15:21: error: expected ':' or '...' before '{' token
case '-':{c=a-b;printf("%d\n",c);break;}
^
prog.c:16:9: error: stray '\357' in program
case '*':{c=a*b;printf("%d\n",c);break;}
^
prog.c:16:9: error: stray '\274' in program
prog.c:16:9: error: stray '\232' in program
prog.c:16:20: error: expected ':' or '...' before '{' token
case '*':{c=a*b;printf("%d\n",c);break;}
^
prog.c:17:9: error: stray '\357' in program
case '/':{c=a/b;printf("%d\n",c);break;}
^
prog.c:17:9: error: stray '\274' in program
prog.c:17:9: error: stray '\232' in program
prog.c:17:20: error: expected ':' or '...' before '{' token
case '/':{c=a/b;printf("%d\n",c);break;}