Ar palindromas?
- [1] 2024-11-09 13:50 (0)
- [2] 2024-11-09 13:52 (100)
- [3] 2024-11-09 14:22 (100)
Taškai: 0
Compile: FAIL
palindromas.cpp: In function ‘bool c(std::string)’: palindromas.cpp:4:10: error: invalid use of member function ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’ (did you forget the ‘()’ ?) 4 | if(s.length == 1) { | ~~^~~~~~ | () palindromas.cpp:7:10: error: invalid use of member function ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’ (did you forget the ‘()’ ?) 7 | if(s.length == 2) { | ~~^~~~~~ | () palindromas.cpp:10:24: error: invalid use of member function ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’ (did you forget the ‘()’ ?) 10 | return s[0] == s[s.length-1] && c(s.substr(1, s.length() - 2)); | ~~^~~~~~ | ()
nr. | result | time | message |
---|