记录详情

Compile Error

/in/foo.cc:9:31: error: expected ';' at end of member declaration
    9 |         Date(int y,int m,int d)
      |                               ^
      |                                ;
/in/foo.cc:10:17: error: 'year' does not name a type
   10 |                 year=y;
      |                 ^~~~
/in/foo.cc:11:17: error: 'month' does not name a type
   11 |                 month=m;
      |                 ^~~~~
/in/foo.cc:12:17: error: 'day' does not name a type
   12 |                 day=d;
      |                 ^~~
/in/foo.cc:13:10: error: expected ';' after class definition
   13 |         }
      |          ^
      |          ;
/in/foo.cc: In function 'bool isLeap()':
/in/foo.cc:16:24: error: 'year' was not declared in this scope
   16 |                 return year%400==0 || (year%4==0 && year%100!=0);
      |                        ^~~~
/in/foo.cc: In function 'int YearMonthDay()':
/in/foo.cc:24:20: error: 'month' was not declared in this scope
   24 |                 if(month==2) return 28+isLeap();
      |                    ^~~~~
/in/foo.cc:25:20: error: 'month' was not declared in this scope
   25 |                 if(month==4 || month==6 || month==9 || month==11) return 30;
      |                    ^~~~~
/in/foo.cc: In function 'void Output()':
/in/foo.cc:34:30: error: 'year' was not declared in this scope
   34 |         void Output(){ cout<<year<<"-"<<month<<"-"<<day<<endl; }
      |                              ^~~~
/in/foo.cc:34:41: error: 'month' was not declared in this scope
   34 |         void Output(){ cout<<year<<"-"<<month<<"-"<<day<<endl; }
      |                                         ^~~~~
/in/foo.cc:34:53: error: 'day' was not declared in this scope
   34 |         void Output(){ cout<<year<<"-"<<month<<"-"<<day<<endl; }
      |                                                     ^~~
/in/foo.cc: In function 'int YearDay()':
/in/foo.cc:35:43: error: 'year' was not declared in this scope
   35 |         int YearDay() { return 365+isLeap(year); }
      |                                           ^~~~
/in/foo.cc: In function 'int Pass()':
/in/foo.cc:39:25: error: 'day' was not declared in this scope
   39 |                 int num=day;
      |                         ^~~
/in/foo.cc:40:34: error: 'month' was not declared in this scope
   40 |                 for(int m1=1; m1<month; m1++)
      |                                  ^~~~~
/in/foo.cc:41:45: error: 'year' was not declared in this scope
   41 |                         num += YearMonthDay(year,m1);
      |                                             ^~~~
/in/foo.cc: At global scope:
/in/foo.cc:51:1: error: expected declaration before '}' token
   51 | };
      | ^
/in/foo.cc: In function 'int Diff(int, int, int, int, int, int)':
/in/foo.cc:59:31: error: too many arguments to function 'int YearDay()'
   59 |                 num += YearDay(y);
      |                        ~~~~~~~^~~
/in/foo.cc:35:13: note: declared here
   35 |         int YearDay() { return 365+isLeap(year); }
      |             ^~~~~~~
/in/foo.cc:60:23: error: too many arguments to function 'int YearDay()'
   60 |         num += YearDay(y1)-Pass(y1,m1,d1);
      |                ~~~~~~~^~~~
/in/foo.cc:35:13: note: declared here
   35 |         int YearDay() { return 365+isLeap(year); }
      |             ^~~~~~~
/in/foo.cc: In function 'int main(int, char**)':
/in/foo.cc:66:17: error: 'y1' was not declared in this scope; did you mean 'd1'?
   66 |         Date d1(y1,m1,d1);
      |                 ^~
      |                 d1
/in/foo.cc:66:20: error: 'm1' was not declared in this scope; did you mean 'd1'?
   66 |         Date d1(y1,m1,d1);
      |                    ^~
      |                    d1
/in/foo.cc:67:17: error: 'y2' was not declared in this scope; did you mean 'd2'?
   67 |         Date d2(y2,m2,d2);
      |                 ^~
      |                 d2
/in/foo.cc:67:20: error: 'm2' was not declared in this scope; did you mean 'd2'?
   67 |         Date d2(y2,m2,d2);
      |                    ^~
      |                    d2
/in/foo.cc:68:18: error: 'class Date' has no member named 'Pass'
   68 |         cout<<d1.Pass()<<endl;
      |                  ^~~~
/in/foo.cc:69:18: error: 'class Date' has no member named 'Pass'
   69 |         cout<<d2.Pass()<<endl;
      |                  ^~~~
/in/foo.cc:70:18: error: 'class Date' has no member named 'Pass'
   70 |         cout<<d1.Pass(2025,2,20)<<endl;
      |                  ^~~~
/in/foo.cc:72:18: error: 'class Date' has no member named 'YearMonthDay'
   72 |         cout<<d2.YearMonthDay()<<endl;
      |                  ^~~~~~~~~~~~
/in/foo.cc:73:18: error: 'class Date' has no member named 'YearMonthDay'
   73 |         cout<<d2.YearMonthDay(2024,2)<<endl;
      |                  ^~~~~~~~~~~~

信息

递交者
类型
自测
语言
C++
递交时间
2025-03-14 22:57:26
评测时间
2025-03-14 22:57:26
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes