ID 5787057
Пользователь Бессмертный Артём Станиславович
Время 20:28<< 16.11.2021 20:42 (27 д. 18:42) 20:51>>
Обработка 20:42 ... 20:42 (3,32 сек.)
Файл 5787057.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача A: Набор фигур
Набор тестов
Ограничения Время: 1с Память: 4096Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:17:0:
figure.h:19:5: error: 'string' does not name a type; did you mean 'stdin'?
     string Name() {
     ^~~~~~
     stdin
figure.h:46:5: error: 'string' does not name a type; did you mean 'stdin'?
     string Name() {
     ^~~~~~
     stdin
figure.h:70:5: error: 'string' does not name a type; did you mean 'stdin'?
     string Name() {
     ^~~~~~
     stdin
figure.h: In member function 'virtual double Circle::Perimeter()':
figure.h:76:9: error: expected ',' or ';' before 'return'
         return x;
         ^~~~~~
figure.h:75:13: error: unused variable 'x' [-Werror=unused-variable]
         int x = 2 * 3.14 * r
             ^
figure.h:77:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Rect; _Args = {int&, int&}; _Tp = Rect]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Rect; _Args = {int&, int&}; _Tp = Rect; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Rect>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {int&, int&}; _Tp = Rect; _Alloc = std::allocator<Rect>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {int&, int&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {int&, int&}; _Tp = Rect; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {int&, int&}; _Tp = Rect]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {int&, int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Rect; _Args = {int&, int&}]'
figure.h:95:47:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Rect'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:39:7: note:   because the following virtual functions are pure within 'Rect':
 class Rect : public Figure {
       ^~~~
figure.h:6:29: note: 	virtual std::__cxx11::string Figure::Name()
         virtual std::string Name() = 0;
                             ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Triangle; _Args = {int&, int&, int&}; _Tp = Triangle]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Triangle; _Args = {int&, int&, int&}; _Tp = Triangle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Triangle>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {int&, int&, int&}; _Tp = Triangle; _Alloc = std::allocator<Triangle>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Triangle; _Alloc = std::allocator<Triangle>; _Args = {int&, int&, int&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Triangle>; _Args = {int&, int&, int&}; _Tp = Triangle; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Triangle>; _Args = {int&, int&, int&}; _Tp = Triangle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Triangle; _Alloc = std::allocator<Triangle>; _Args = {int&, int&, int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Triangle; _Args = {int&, int&, int&}]'
figure.h:99:58:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Triangle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:11:7: note:   because the following virtual functions are pure within 'Triangle':
 class Triangle : public Figure {
       ^~~~~~~~
figure.h:6:29: note: 	virtual std::__cxx11::string Figure::Name()
         virtual std::string Name() = 0;
                             ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Circle; _Args = {int&}; _Tp = Circle]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Circle; _Args = {int&}; _Tp = Circle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Circle>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {int&}; _Tp = Circle; _Alloc = std::allocator<Circle>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Circle; _Alloc = std::allocator<Circle>; _Args = {int&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Circle>; _Args = {int&}; _Tp = Circle; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Circle>; _Args = {int&}; _Tp = Circle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Circle; _Alloc = std::allocator<Circle>; _Args = {int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Circle; _Args = {int&}]'
figure.h:103:44:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Circle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:64:7: note:   because the following virtual functions are pure within 'Circle':
 class Circle : public Figure {
       ^~~~~~
figure.h:6:29: note: 	virtual std::__cxx11::string Figure::Name()
         virtual std::string Name() = 0;
                             ^~~~
cc1plus: all warnings being treated as errors
0.266s 0.011s 9