ID 5482267
Пользователь Морозов Денис Витальевич
Время 23:05<< 13.10.2021 23:06 (28 д. 13:40) 23:07>>
Обработка 23:06 ... 23:06 (2,72 сек.)
Файл 5482267.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 1, осень 2021
Задача E: Date
Набор тестов
Ограничения Время: 1с Память: 512Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:16:0:
date.h:96:2: error: expected ';' after class definition
 }
  ^
  ;
date.h: In constructor 'Date::Date(int, int, int)':
date.h:6:11: error: class 'Date' does not have any field named 'year'
         : year(year), month(month), day(day) {
           ^~~~
date.h:6:23: error: class 'Date' does not have any field named 'month'
         : year(year), month(month), day(day) {
                       ^~~~~
date.h:6:37: error: class 'Date' does not have any field named 'day'
         : year(year), month(month), day(day) {
                                     ^~~
date.h: In member function 'bool Date::IsLeap() const':
date.h:10:19: error: 'const class Date' has no member named 'year'
         if (this->year % 4 == 0) {
                   ^~~~
date.h:11:23: error: 'const class Date' has no member named 'year'
             if (this->year % 100 == 0) {
                       ^~~~
date.h:12:27: error: 'const class Date' has no member named 'year'
                 if (this->year % 400 == 0) {
                           ^~~~
date.h: In member function 'std::__cxx11::string Date::ToString()':
date.h:26:36: error: 'class Date' has no member named 'day'
         std::string output = this->day + "." + this->month + "." + this->year;
                                    ^~~
date.h:26:54: error: 'class Date' has no member named 'month'
         std::string output = this->day + "." + this->month + "." + this->year;
                                                      ^~~~~
date.h:26:74: error: 'class Date' has no member named 'year'
         std::string output = this->day + "." + this->month + "." + this->year;
                                                                          ^~~~
date.h: In member function 'Date Date::DaysLater(int)':
date.h:32:30: error: 'class Date' has no member named 'year'
         int year_out = this->year;
                              ^~~~
date.h:33:31: error: 'class Date' has no member named 'month'
         int month_out = this->month;
                               ^~~~~
date.h:34:29: error: 'class Date' has no member named 'day'
         int day_out = this->day;
                             ^~~
date.h: In member function 'int Date::DaysLeft(const Date&)':
date.h:89:31: error: 'class Date' has no member named 'year'
         abs_now = 365 * this->year + this->year/4 - this->year/100 +
                               ^~~~
date.h:89:44: error: 'class Date' has no member named 'year'
         abs_now = 365 * this->year + this->year/4 - this->year/100 +
                                            ^~~~
date.h:89:59: error: 'class Date' has no member named 'year'
         abs_now = 365 * this->year + this->year/4 - this->year/100 +
                                                           ^~~~
date.h:90:25: error: 'class Date' has no member named 'year'
                   this->year/400 + (153*this->month - 457)/5 + this->day - 306;
                         ^~~~
date.h:90:47: error: 'class Date' has no member named 'month'
                   this->year/400 + (153*this->month - 457)/5 + this->day - 306;
                                               ^~~~~
date.h:90:70: error: 'class Date' has no member named 'day'
                   this->year/400 + (153*this->month - 457)/5 + this->day - 306;
                                                                      ^~~
date.h:91:31: error: 'const class Date' has no member named 'year'
         abs_then = 365 * date.year + date.year/4 - date.year/100 + date.year/400
                               ^~~~
date.h:91:43: error: 'const class Date' has no member named 'year'
         abs_then = 365 * date.year + date.year/4 - date.year/100 + date.year/400
                                           ^~~~
date.h:91:57: error: 'const class Date' has no member named 'year'
         abs_then = 365 * date.year + date.year/4 - date.year/100 + date.year/400
                                                         ^~~~
date.h:91:73: error: 'const class Date' has no member named 'year'
         abs_then = 365 * date.year + date.year/4 - date.year/100 + date.year/400
                                                                         ^~~~
date.h:92:29: error: 'const class Date' has no member named 'month'
                 + (153*date.month - 457)/5 + date.day - 306;
                             ^~~~~
date.h:92:51: error: 'const class Date' has no member named 'day'
                 + (153*date.month - 457)/5 + date.day - 306;
                                                   ^~~
date.h: In member function 'bool Date::IsLeap() const':
date.h:23:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: all warnings being treated as errors
[печатать | |
]
(2 547 b)
0.077s 0.014s 10