foo.cc: In function 'int main()':
foo.cc:12:33: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
12 | tempi = atoi(com[flag+1])*atoi(com[flag-1]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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 foo.cc:1:
/usr/include/stdlib.h:361:1: note: initializing argument 1 of 'int atoi(const char*)'
361 | __NTH (atoi (const char *__nptr))
| ^~~~~
foo.cc:12:51: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
12 | tempi = atoi(com[flag+1])*atoi(com[flag-1]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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 foo.cc:1:
/usr/include/stdlib.h:361:1: note: initializing argument 1 of 'int atoi(const char*)'
361 | __NTH (atoi (const char *__nptr))
| ^~~~~
foo.cc:18:33: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
18 | tempi = atoi(com[flag+1])+atoi(com[flag-1]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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 foo.cc:1:
/usr/include/stdlib.h:361:1: note: initializing argument 1 of 'int atoi(const char*)'
361 | __NTH (atoi (const char *__nptr))
| ^~~~~
foo.cc:18:51: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
18 | tempi = atoi(com[flag+1])+atoi(com[flag-1]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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 foo.cc:1:
/usr/include/stdlib.h:361:1: note: initializing argument 1 of 'int atoi(const char*)'
361 | __NTH (atoi (const char *__nptr))
| ^~~~~
foo.cc:24:25: error: expected ';' before '}' token
24 | cout<<com[len-4]
| ^
| ;
25 | }
| ~
foo.cc:27:25: error: expected ';' before '}' token
27 | cout<<com[len-3]
| ^
| ;
28 | }if(com[len-2] != '0'){
| ~
foo.cc:29:25: error: expected ';' before '}' token
29 | cout<<com[len-2]
| ^
| ;
30 | }
| ~
[Hydro](https://hydro.ac)提供评测服务