记录详情

Compile Error

foo.c: In function 'days_date':
foo.c:3:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    3 | #define leapYear(y)  ((y%4==0)&&(y%100!=0)||(y%400==0))
      |                       ~~~~~~~~^~~~~~~~~~~~
foo.c:16:21: note: in expansion of macro 'leapYear'
   16 |                 if (leapYear(i))
      |                     ^~~~~~~~
foo.c:20:22: error: 'i' undeclared (first use in this function)
   20 |         if (leapYear(i))
      |                      ^
foo.c:3:24: note: in definition of macro 'leapYear'
    3 | #define leapYear(y)  ((y%4==0)&&(y%100!=0)||(y%400==0))
      |                        ^
foo.c:20:22: note: each undeclared identifier is reported only once for each function it appears in
   20 |         if (leapYear(i))
      |                      ^
foo.c:3:24: note: in definition of macro 'leapYear'
    3 | #define leapYear(y)  ((y%4==0)&&(y%100!=0)||(y%400==0))
      |                        ^
foo.c: In function 'diff':
foo.c:32:16: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   32 |         return abs(days_date(s1)-days_date(s2));
      |                ^~~
foo.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | #define leapYear(y)  ((y%4==0)&&(y%100!=0)||(y%400==0))
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1083 xf1-6计算日期
语言
C
递交时间
2022-08-27 14:49:27
评测时间
2022-08-27 14:49:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes