foo.c:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
foo.c:3:1: error: unknown type name 'using'
3 | using namespace std;
| ^~~~~
foo.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
3 | using namespace std;
| ^~~
foo.c:5:1: error: unknown type name 'ifstream'
5 | ifstream fin("a.in");
| ^~~~~~~~
foo.c:5:14: error: expected declaration specifiers or '...' before string constant
5 | ifstream fin("a.in");
| ^~~~~~
foo.c:7:1: error: unknown type name 'ofstream'
7 | ofstream fout("a.out");
| ^~~~~~~~
foo.c:7:15: error: expected declaration specifiers or '...' before string constant
7 | ofstream fout("a.out");
| ^~~~~~~
foo.c: In function 'main':
foo.c:15:1: error: 'fin' undeclared (first use in this function)
15 | fin>>m;
| ^~~
foo.c:15:1: note: each undeclared identifier is reported only once for each function it appears in
foo.c:19:10: error: invalid operands to binary - (have 'int' and 'int *')
19 | b[i]=a[i]-a;
| ~~~~^
| | |
| | int *
| int
foo.c:19:12: error: expected ')' before ';' token
19 | b[i]=a[i]-a;
| ^
| )
foo.c:17:4: note: to match this '('
17 | for(i=1;i>a[i];
| ^
foo.c:21:1: error: expected expression before '}' token
21 | }
| ^
foo.c:13:23: warning: variable 'b' set but not used [-Wunused-but-set-variable]
13 | int i,j,m,a[1001]={0},b[1001]={0};
| ^
foo.c:13:7: warning: unused variable 'j' [-Wunused-variable]
13 | int i,j,m,a[1001]={0},b[1001]={0};
| ^
foo.c: At top level:
foo.c:23:1: warning: data definition has no type or storage class
23 | j=b[m]-b[m-1]+b[m];
| ^
foo.c:23:1: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
foo.c:23:3: error: 'b' undeclared here (not in a function)
23 | j=b[m]-b[m-1]+b[m];
| ^
foo.c:23:5: error: 'm' undeclared here (not in a function)
23 | j=b[m]-b[m-1]+b[m];
| ^
foo.c:25:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
25 | fout
| ^~~~
[Hydro](https://hydro.ac)提供评测服务