记录详情

Compile Error

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天
      |             ^

信息

递交者
类型
递交
比赛
南师大(含泰州学院)2024年新生赛(第一场)
语言
C
递交时间
2024-08-16 18:57:22
评测时间
2024-08-16 18:57:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes