ID 5482038
Пользователь Кузьмин Павел Владимирович
Время 22:33<< 13.10.2021 22:34 (28 д. 13:07) 22:36>>
Обработка 22:34 ... 22:34 (3,00 сек.)
Файл 5482038.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:9:1: error: 'Date' does not name a type
 Date::Date(int year, int month, int day) :
 ^~~~
date.h:13:6: error: 'Date' has not been declared
 bool Date::IsLeap() {
      ^~~~
date.h: In function 'bool IsLeap()':
date.h:14:7: error: 'year' was not declared in this scope
   if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
       ^~~~
date.h:14:7: note: suggested alternative: 'char'
   if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
       ^~~~
       char
date.h: At global scope:
date.h:18:13: error: 'Date' has not been declared
 std::string Date::ToString() const {
             ^~~~
date.h:18:30: error: non-member function 'std::__cxx11::string ToString()' cannot have cv-qualifier
 std::string Date::ToString() const {
                              ^~~~~
date.h: In function 'std::__cxx11::string ToString()':
date.h:20:12: error: 'day' was not declared in this scope
   dates += day < 10 ? + "0" + std::to_string(day) +
            ^~~
date.h:20:12: note: suggested alternative: 'JDay'
   dates += day < 10 ? + "0" + std::to_string(day) +
            ^~~
            JDay
date.h:22:12: error: 'month' was not declared in this scope
   dates += month < 10 ? + "0" + std::to_string(month) +
            ^~~~~
date.h:24:7: error: 'year' was not declared in this scope
   if (year < 10)
       ^~~~
date.h:24:7: note: suggested alternative: 'char'
   if (year < 10)
       ^~~~
       char
date.h: At global scope:
date.h:34:1: error: 'Date' does not name a type
 Date Date::DaysLater(int days) const {
 ^~~~
date.h:49:5: error: 'Date' has not been declared
 int Date::DaysLeft(const Date& date) const {
     ^~~~
date.h:49:26: error: 'Date' does not name a type
 int Date::DaysLeft(const Date& date) const {
                          ^~~~
date.h:49:38: error: non-member function 'int DaysLeft(const int&)' cannot have cv-qualifier
 int Date::DaysLeft(const Date& date) const {
                                      ^~~~~
date.h: In function 'int DaysLeft(const int&)':
date.h:50:26: error: 'year' was not declared in this scope
     int64_t jday1 = JDay(year, month, day);
                          ^~~~
date.h:50:26: note: suggested alternative: 'char'
     int64_t jday1 = JDay(year, month, day);
                          ^~~~
                          char
date.h:50:32: error: 'month' was not declared in this scope
     int64_t jday1 = JDay(year, month, day);
                                ^~~~~
date.h:50:39: error: 'day' was not declared in this scope
     int64_t jday1 = JDay(year, month, day);
                                       ^~~
date.h:50:39: note: suggested alternative: 'jday1'
     int64_t jday1 = JDay(year, month, day);
                                       ^~~
                                       jday1
date.h:51:31: error: request for member 'year' in 'date', which is of non-class type 'const int'
     int64_t jday2 = JDay(date.year, date.month, date.day);
                               ^~~~
date.h:51:42: error: request for member 'month' in 'date', which is of non-class type 'const int'
     int64_t jday2 = JDay(date.year, date.month, date.day);
                                          ^~~~~
date.h:51:54: error: request for member 'day' in 'date', which is of non-class type 'const int'
     int64_t jday2 = JDay(date.year, date.month, date.day);
                                                      ^~~
date.h: In function 'int64_t JDay(int, int, int)':
date.h:62:22: error: expected initializer before 'J'
     unsigned int64_t J;
                      ^
date.h:65:5: error: 'J' was not declared in this scope
     J = 1461L * int64_t(year);
     ^
date.h:67:22: error: expected initializer before 'K'
     unsigned int64_t K = 306001L * int64_t(month + 1);
                      ^
date.h:68:5: error: 'K' was not declared in this scope
     K /= 10000L;
     ^
main.cpp: In function 'int main()':
main.cpp:20:9: error: 'Date' was not declared in this scope
         Date dt(1997, 1, 19);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:21:17: error: 'dt' was not declared in this scope
         assert(!dt.IsLeap());
                 ^
main.cpp:25:9: error: 'Date' was not declared in this scope
         Date dt(100, 10, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:26:17: error: 'dt' was not declared in this scope
         assert(!dt.IsLeap());
                 ^
main.cpp:30:9: error: 'Date' was not declared in this scope
         Date dt(1, 1, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:31:17: error: 'dt' was not declared in this scope
         assert(!dt.IsLeap());
                 ^
main.cpp:35:9: error: 'Date' was not declared in this scope
         Date dt(2000, 10, 22);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:36:16: error: 'dt' was not declared in this scope
         assert(dt.IsLeap());
                ^
main.cpp:40:9: error: 'Date' was not declared in this scope
         Date dt(400, 1, 9);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:41:16: error: 'dt' was not declared in this scope
         assert(dt.IsLeap());
                ^
main.cpp:45:9: error: 'Date' was not declared in this scope
         Date dt(1996, 7, 8);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:46:16: error: 'dt' was not declared in this scope
         assert(dt.IsLeap());
                ^
main.cpp:50:9: error: 'Date' was not declared in this scope
         Date dt(2000, 1, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:51:16: error: 'dt' was not declared in this scope
         assert(dt.DaysLater(0).ToString() == "01.01.2000");
                ^
main.cpp:59:9: error: 'Date' was not declared in this scope
         Date dt(2001, 1, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:60:16: error: 'dt' was not declared in this scope
         assert(dt.DaysLater(0).ToString() == "01.01.2001");
                ^
main.cpp:68:9: error: 'Date' was not declared in this scope
         Date dt(2000, 1, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:69:16: error: 'dt' was not declared in this scope
         assert(dt.DaysLeft(Date{2000, 1, 1}) == 0);
                ^
main.cpp:69:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2000, 1, 1}) == 0);
                                ^
main.cpp:70:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2000, 1, 11}) == 10);
                                ^
main.cpp:71:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2000, 1, 31}) == 30);
                                ^
main.cpp:72:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2000, 2, 1}) == 31);
                                ^
main.cpp:73:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2000, 3, 1}) == 60);
                                ^
main.cpp:74:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 1, 1}) == 366);
                                ^
main.cpp:77:9: error: 'Date' was not declared in this scope
         Date dt(2001, 1, 1);
         ^~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:15:
main.cpp:78:16: error: 'dt' was not declared in this scope
         assert(dt.DaysLeft(Date{2001, 1, 1}) == 0);
                ^
main.cpp:78:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 1, 1}) == 0);
                                ^
main.cpp:79:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 1, 11}) == 10);
                                ^
main.cpp:80:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 1, 31}) == 30);
                                ^
main.cpp:81:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 2, 1}) == 31);
                                ^
main.cpp:82:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2001, 3, 1}) == 59);
                                ^
main.cpp:83:32: error: expected ')' before '{' token
         assert(dt.DaysLeft(Date{2002, 1, 1}) == 365);
                                ^
[печатать | |
]
(1 953 b)
0.410s 0.010s 10