记录详情

Compile Error

/in/foo.cc: In function 'int days(d, d)':
/in/foo.cc:10:7: error: expected unqualified-id before 'int'
 int i,int td=0;
       ^~~
/in/foo.cc:12:1: error: 'td' was not declared in this scope
 td+=leap(i)?366:365;
 ^~
/in/foo.cc:2:40: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
 #define leap(y) ((y)%400==0||(y)%100!=0&&(y)%4==0)
                              ~~~~~~~~~~^~~~~~~~~~
/in/foo.cc:12:5: note: in expansion of macro 'leap'
 td+=leap(i)?366:365;
     ^~~~
/in/foo.cc:14:1: error: 'td' was not declared in this scope
 td-=mon[leap(d1.y)][i];
 ^~
/in/foo.cc:2:40: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
 #define leap(y) ((y)%400==0||(y)%100!=0&&(y)%4==0)
                              ~~~~~~~~~~^~~~~~~~~~
/in/foo.cc:14:9: note: in expansion of macro 'leap'
 td-=mon[leap(d1.y)][i];
         ^~~~
/in/foo.cc:15:1: error: 'td' was not declared in this scope
 td-=d1.d-1;
 ^~
/in/foo.cc:2:40: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
 #define leap(y) ((y)%400==0||(y)%100!=0&&(y)%4==0)
                              ~~~~~~~~~~^~~~~~~~~~
/in/foo.cc:17:9: note: in expansion of macro 'leap'
 td+=mon[leap(d2.y)][i];
         ^~~~

信息

递交者
类型
递交
题目
15-1 改错题
语言
C++
递交时间
2021-06-13 10:11:59
评测时间
2021-06-13 10:11:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes