foo.c: In function ‘main’:
foo.c:7:40: error: invalid suffix "!" on integer constant
7 | D = 30*m+(m/2)-(2-(y%4==0 && y%100!=0 || y%400=0))*((m=9)/12)+d+(m/9)*(m%2)-31;
| ^~~~~
foo.c:7:56: error: lvalue required as left operand of assignment
7 | D = 30*m+(m/2)-(2-(y%4==0 && y%100!=0 || y%400=0))*((m=9)/12)+d+(m/9)*(m%2)-31;
| ^
foo.c:8:32: error: expected ‘)’ before ‘,y’
8 | printf("%d年已过去%d天",y,D);
| ~ ^~~
| )
foo.c:8:18: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
8 | printf("%d年已过去%d天",y,D);
| ~^
| |
| int
foo.c:8:28: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
8 | printf("%d年已过去%d天",y,D);
| ~^
| |
| int
foo.c:5:13: warning: variable ‘D’ set but not used [-Wunused-but-set-variable]
5 | int D,m,d,y;//到y年m月n日为止,今年已过去D天
| ^