记录详情

Compile Error

foo.c: In function 'DaysOfAMonth':
foo.c:6:24: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    6 |         if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~
foo.c: In function 'DaysOfAYear':
foo.c:13:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   13 |         return y%4==0&&y%100!=0||y%400==0?366:365;
      |                ~~~~~~^~~~~~~~~~
foo.c: In function 'main':
foo.c:19:32: error: 'res' undeclared (first use in this function)
   19 |         int sum1=0,sum2=0,sum3;res=0;
      |                                ^~~
foo.c:19:32: note: each undeclared identifier is reported only once for each function it appears in
foo.c:21:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   21 |         for(int i=y1,i<y2;i++)
      |                       ^
foo.c:21:30: error: expected ';' before ')' token
   21 |         for(int i=y1,i<y2;i++)
      |                              ^
      |                              ;
foo.c:27:27: error: too few arguments to function 'DaysOfAMonth'
   27 |                 sum2=sum2+DaysOfAMonth(i);
      |                           ^~~~~~~~~~~~
foo.c:3:5: note: declared here
    3 | int DaysOfAMonth(int y, int m)
      |     ^~~~~~~~~~~~
foo.c:31:27: error: too few arguments to function 'DaysOfAMonth'
   31 |                 sum3=sum2+DaysOfAMonth(i);
      |                           ^~~~~~~~~~~~
foo.c:3:5: note: declared here
    3 | int DaysOfAMonth(int y, int m)
      |     ^~~~~~~~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1004 OO1-4 日期类Date
语言
C
递交时间
2022-09-29 22:22:15
评测时间
2022-09-29 22:22:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes