记录详情

Compile Error

foo.cc: In member function 'Date Date::operator+(int)':
foo.cc:19:38: error: 'class Date' has no member named 'year'
   int mon[13]={0,31,28+runnian(this->year),31,30,31,30,31,31,30,31,30,31};
                                      ^
foo.cc:19:42: error: 'runnian' was not declared in this scope
   int mon[13]={0,31,28+runnian(this->year),31,30,31,30,31,31,30,31,30,31};
                                          ^
foo.cc:20:9: error: 'class Date' has no member named 'day'
   this->day+=num;
         ^
foo.cc:21:19: error: 'class Date' has no member named 'month'
   while(mon[this->month]<this->day)
                   ^
foo.cc:21:32: error: 'class Date' has no member named 'day'
   while(mon[this->month]<this->day)
                                ^
foo.cc:23:10: error: 'class Date' has no member named 'day'
    this->day-=mon[this->month];
          ^
foo.cc:23:25: error: 'class Date' has no member named 'month'
    this->day-=mon[this->month];
                         ^
foo.cc:24:10: error: 'class Date' has no member named 'month'
    this->month+=1;
          ^
foo.cc:25:13: error: 'class Date' has no member named 'month'
    if(this->month>12)
             ^
foo.cc:27:11: error: 'class Date' has no member named 'month'
     this->month=1;
           ^
foo.cc:28:11: error: 'class Date' has no member named 'year'
     this->year+=1;
           ^

自豪的采用 HydroJudger 进行评测(github.com/hydro-dev/HydroJudger)

信息

递交者
类型
递交
题目
P1003 OO1-3 日期类Date
语言
C++
递交时间
2020-04-07 17:44:37
评测时间
2020-04-07 17:44:37
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes