Problem sumint
User sporknives
Submission Time 2024-05-16 18:22:17
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp: In function ‘int main()’:
sumint.cpp:9:7: error: conflicting declaration ‘long int d’
9 | long d = stol(d);
| ^
sumint.cpp:5:9: note: previous declaration as ‘std::string d’
5 | string d;
| ^
sumint.cpp:10:17: error: no match for ‘operator<’ (operand types are ‘int’ and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
10 | for (int i=0; i<d; i++) {
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from sumint.cpp:1:
/usr/include/c++/9/bits/stl_pair.h:45