foo.cc: In function 'int main()':
foo.cc:12:28: error: expected primary-expression before '[' token
12 | tempi = atoi(string[flag+1])*atoi(string[flag-1]);
| ^
foo.cc:12:49: error: expected primary-expression before '[' token
12 | tempi = atoi(string[flag+1])*atoi(string[flag-1]);
| ^
foo.cc:18:28: error: expected primary-expression before '[' token
18 | tempi = atoi(string[flag+1])+atoi(string[flag-1]);
| ^
foo.cc:18:49: error: expected primary-expression before '[' token
18 | tempi = atoi(string[flag+1])+atoi(string[flag-1]);
| ^
foo.cc:23:5: error: expected ',' or ';' before 'cout'
23 | cout<<com[len-4]<<com[len-3]<<com[len-2]<<com[len-1];
| ^~~~
foo.cc:22:9: warning: unused variable 'len' [-Wunused-variable]
22 | int len = com.length()
| ^~~
[Hydro](https://hydro.ac)提供评测服务