foo.c: In function 'main':
foo.c:5:11: error: conflicting types for 'a'
5 | double a, b, sum;
| ^
foo.c:4:10: note: previous declaration of 'a' was here
4 | int n, a,b;
| ^
foo.c:5:14: error: conflicting types for 'b'
5 | double a, b, sum;
| ^
foo.c:4:12: note: previous declaration of 'b' was here
4 | int n, a,b;
| ^
foo.c:6:3: warning: statement with no effect [-Wunused-value]
6 | sum 0;
| ^~~
foo.c:6:6: error: expected ';' before numeric constant
6 | sum 0;
| ^~
| ;
foo.c:9:9: error: expected ';' before ':' token
9 | for(b=0:b<n;b++);
| ^
| ;
foo.c:9:17: error: expected ';' before ')' token
9 | for(b=0:b<n;b++);
| ^
| ;
foo.c:10:11: warning: unknown conversion type character ' ' in format [-Wformat=]
10 | scanf("% %1f", &a, &b);
| ^
foo.c:10:14: warning: format '%f' expects argument of type 'float *', but argument 2 has type 'double *' [-Wformat=]
10 | scanf("% %1f", &a, &b);
| ~~^ ~~
| | |
| | double *
| float *
| %1lf
foo.c:10:9: warning: too many arguments for format [-Wformat-extra-args]
10 | scanf("% %1f", &a, &b);
| ^~~~~~~
foo.c:11:7: warning: statement with no effect [-Wunused-value]
11 | sum + a/b;
| ~~~~^~~~~
foo.c:13:10: error: 'O' undeclared (first use in this function)
13 | return O;
| ^
foo.c:13:10: note: each undeclared identifier is reported only once for each function it appears in
foo.c:7:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
foo.c:10:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
10 | scanf("% %1f", &a, &b);
| ^~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务