| Problem | bombardirocrocodilo |
|---|---|
| User | yuanbin |
| Submission Time | 2026-04-18 11:04:22 |
| Score | 0 |
| Max Time | N/A |
| Max Memory | N/A |
Owl Get a Life
bombardirocrocodilo.cpp: In function ‘int main()’:
bombardirocrocodilo.cpp:8:19: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
8 | if (ammo[strlen(ammo) - 1]=='1'||ammo[strlen(ammo) - 1]=='3'||ammo[strlen(ammo) - 1]=='5'||ammo[strlen(ammo) - 1]=='7'||ammo[strlen(ammo) - 1]=='9'){
| ^~~~
| |
| int
In file included from /usr/include/c++/9/cstring:42,
from bombardirocrocodilo.cpp:2:
/usr/include/string.h:385:35: note: initializing argument 1 of ‘size_t strlen(const char*)’
385 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
bombardirocrocodilo.cpp:8:28: error: invalid types ‘int[size_t {aka long unsigned int}]’ for array subscript
8 | if (ammo[strlen(ammo) - 1]=='1'||ammo[strlen(ammo) - 1]=='3'||ammo[strlen(ammo) - 1]=='5'||ammo[strlen(ammo) - 1]=='7'||ammo[strlen(ammo) - 1]=='9'){