Problem | evenorodd |
---|---|
User | loverin |
Submission Time | 2023-04-10 15:15:48 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
evenorodd.cpp: In function ‘int main()’:
evenorodd.cpp:7:14: error: no match for ‘operator[]’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘std::__cxx11::basic_string<char>::iterator’ {aka ‘__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >’})
7 | int temp = s[s.end()] % 2;
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from evenorodd.cpp:1:
/usr/include/c++/9/bits/basic_string.h:1050:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](st