ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1226. esreveR redrO

Read input until the end in C/C++
Posted by Hristo Nikolaev (B&W) 1 Dec 2022 01:35
Reading the entire input char by char can be done quickly this way:

while ((input = (char)getchar())) {
     if (input == EOF) {
          break;
     }
Re: Read input until the end in C/C++
Posted by denxxjkee 1 Jun 2024 22:02
The canonical way is:

while ((input = std::getc()) != EOF) {
     ...
}