Submission #122271

#TimeUsernameProblemLanguageResultExecution timeMemory
122271khulegubAliens (IOI07_aliens)C++14
Compilation error
0 ms0 KiB
long long int read_int(){ char r; bool start=false,neg=false; long long int ret=0; while(true){ r=getchar(); if((r-'0'<0 || r-'0'>9) && r!='-' && !start){ continue; } if((r-'0'<0 || r-'0'>9) && r!='-' && start){ break; } if(start)ret*=10; start=true; if(r=='-')neg=true; else ret+=r-'0'; } if(!neg) return ret; else return -ret; }

Compilation message (stderr)

aliens.cpp: In function 'long long int read_int()':
aliens.cpp:6:5: error: 'getchar' was not declared in this scope
   r=getchar();
     ^~~~~~~
aliens.cpp:6:5: note: suggested alternative: 'char'
   r=getchar();
     ^~~~~~~
     char