foo.c: In function 'main':
foo.c:6:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
6 | scanf('%d%d',&a,&b);
| ^~~~~
foo.c:6:15: warning: multi-character character constant [-Wmultichar]
6 | scanf('%d%d',&a,&b);
| ^~~~~~
foo.c:6:23: error: 'a' undeclared (first use in this function)
6 | scanf('%d%d',&a,&b);
| ^
foo.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
foo.c:6:26: error: 'b' undeclared (first use in this function)
6 | scanf('%d%d',&a,&b);
| ^
foo.c:6:15: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
6 | scanf('%d%d',&a,&b);
| ^~~~~~
| |
| int
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:421:42: note: expected 'const char * restrict' but argument is of type 'int'
421 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:8:38: error: expected ';' before 'break'
8 | case '+': printf(a+b)break;
| ^~~~~
| ;
foo.c:9:13: error: case label not within a switch statement
9 | case '-': printf(a-b)break;
| ^~~~
foo.c:9:34: error: expected ';' before 'break'
9 | case '-': printf(a-b)break;
| ^~~~~
| ;
[Hydro](https://hydro.ac)提供评测服务