Problem exam
User qiutian
Submission Time 2026-01-07 10:52:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:9:30: error: cannot convert ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const char*’
9 | lines.push_back(atoi(temp));
| ^~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/9/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:528,
from /usr/include/c++/9/iostream:38,
from exam.cpp:1:
/usr/include/stdlib.h:361:1: note: initializing argument 1 of ‘int atoi(const char*)’
361 | __NTH (atoi (const char *__nptr))
| ^~~~~
exam.cpp:14:20: error: no match for ‘operator*’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<