foo.c: In function 'main':
foo.c:16:28: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
16 | if (year1 % 4 == 0 && year1 % 100 != 0 || year1 % 400 == 0) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
foo.c:21:21: warning: unused variable 'x' [-Wunused-variable]
21 | int x;
| ^
foo.c:32:28: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
32 | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
| ~~~~~~~~~~~^~~~~~~~~~~~~~~
foo.c:39:28: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
39 | if (year1 % 4 == 0 && year1 % 100 != 0 || year1 % 400 == 0) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
foo.c:40:20: error: too many arguments to function 'day'
40 | sum += day(year2, month2, day2) + 365 - day(year2, month2, day2);
| ^~~
foo.c:2:5: note: declared here
2 | int day(int year);
| ^~~
foo.c:40:53: error: too many arguments to function 'day'
40 | sum += day(year2, month2, day2) + 365 - day(year2, month2, day2);
| ^~~
foo.c:2:5: note: declared here
2 | int day(int year);
| ^~~
foo.c:43:20: error: too many arguments to function 'day'
43 | sum += day(year2, month2, day2) + 366 - day(year2, month2, day2);
| ^~~
foo.c:2:5: note: declared here
2 | int day(int year);
| ^~~
foo.c:43:53: error: too many arguments to function 'day'
43 | sum += day(year2, month2, day2) + 366 - day(year2, month2, day2);
| ^~~
foo.c:2:5: note: declared here
2 | int day(int year);
| ^~~
foo.c: At top level:
foo.c:48:5: error: conflicting types for 'day'; have 'int(int, int, int)'
48 | int day(int year, int m, int d)
| ^~~
foo.c:2:5: note: previous declaration of 'day' with type 'int(int)'
2 | int day(int year);
| ^~~
foo.c: In function 'day':
foo.c:53:23: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
53 | if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务