foo.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
foo.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
foo.c: In function 'main':
foo.c:7:15: error: 'true' undeclared (first use in this function)
7 | while(true){
| ^~~~
foo.c:2:1: note: 'true' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 | using namespace std;
foo.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
7 | while(true){
| ^~~~
foo.c:8:17: error: 'y' undeclared (first use in this function)
8 | y=x/2;
| ^
foo.c:9:17: error: 'z' undeclared (first use in this function)
9 | z=x%2
| ^
foo.c:9:22: error: expected ';' before 'if'
9 | z=x%2
| ^
| ;
10 | if(y!=1)
| ~~
foo.c:14:17: error: 'else' without a previous 'if'
14 | else
| ^~~~
foo.c:15:32: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
15 | printf(1);
| ^
| |
| int
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:356:43: note: expected 'const char * restrict' but argument is of type 'int'
356 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:5:15: warning: unused variable 'y\U0000ff0cz' [-Wunused-variable]
5 | int x,y,z;
| ^~~~
[Hydro](https://hydro.ac)提供评测服务