foo.c:4:8: error: expected declaration specifiers or '...' before string constant
4 | scanf("%d%d%d",&year1,&month1,&day1);
| ^~~~~~~~
foo.c:4:17: error: expected declaration specifiers or '...' before '&' token
4 | scanf("%d%d%d",&year1,&month1,&day1);
| ^
foo.c:4:24: error: expected declaration specifiers or '...' before '&' token
4 | scanf("%d%d%d",&year1,&month1,&day1);
| ^
foo.c:4:32: error: expected declaration specifiers or '...' before '&' token
4 | scanf("%d%d%d",&year1,&month1,&day1);
| ^
foo.c:5:8: error: expected declaration specifiers or '...' before string constant
5 | scanf("%d%d%d",&year2,&month2,&day2);
| ^~~~~~~~
foo.c:5:17: error: expected declaration specifiers or '...' before '&' token
5 | scanf("%d%d%d",&year2,&month2,&day2);
| ^
foo.c:5:24: error: expected declaration specifiers or '...' before '&' token
5 | scanf("%d%d%d",&year2,&month2,&day2);
| ^
foo.c:5:32: error: expected declaration specifiers or '...' before '&' token
5 | scanf("%d%d%d",&year2,&month2,&day2);
| ^
foo.c:6:2: warning: data definition has no type or storage class
6 | leap1=(year1%400==0||year1%4==0&&year1%100!=0);//2020年不是闰年
| ^~~~~
foo.c:6:2: warning: type defaults to 'int' in declaration of 'leap1' [-Wimplicit-int]
foo.c:6:33: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
6 | leap1=(year1%400==0||year1%4==0&&year1%100!=0);//2020年不是闰年
| ~~~~~~~~~~^~~~~~~~~~~~~~
foo.c:6:8: error: initializer element is not constant
6 | leap1=(year1%400==0||year1%4==0&&year1%100!=0);//2020年不是闰年
| ^
foo.c:7:2: warning: data definition has no type or storage class
7 | leap2=(year2%400==0||year2%4==0&&year2%100!=0);
| ^~~~~
foo.c:7:2: warning: type defaults to 'int' in declaration of 'leap2' [-Wimplicit-int]
foo.c:7:33: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
7 | leap2=(year2%400==0||year2%4==0&&year2%100!=0);
| ~~~~~~~~~~^~~~~~~~~~~~~~
foo.c:7:8: error: initializer element is not constant
7 | leap2=(year2%400==0||year2%4==0&&year2%100!=0);
| ^
foo.c:8:3: error: expected identifier or '(' before 'for'
8 | for(i=1;i<month1;i++)
| ^~~
foo.c:8:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
8 | for(i=1;i<month1;i++)
| ^
foo.c:8:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
8 | for(i=1;i<month1;i++)
| ^~
foo.c:12:3: error: expected identifier or '(' before 'for'
12 | for(i=1;i<month2;i++)
| ^~~
foo.c:12:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
12 | for(i=1;i<month2;i++)
| ^
foo.c:12:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
12 | for(i=1;i<month2;i++)
| ^~
foo.c:17:3: error: expected identifier or '(' before 'if'
17 | if(year1==year2)
| ^~
foo.c:28:3: error: expected identifier or '(' before 'if'
28 | if(year1!=year2)
| ^~
foo.c:47:2: error: expected identifier or '(' before 'return'
47 | return 0;
| ^~~~~~
foo.c:48:1: error: expected identifier or '(' before '}' token
48 | }//首先判断一天到一月一日的时间距离
| ^
[Hydro](https://hydro.ac)提供评测服务