• + 1 comment

    HackerRank tells you all you need to know about the input, so it's a completely different situation from an arbitrary CLI. This approach works for the type of problems on this particular site, and for the typical use case where input comes from a terminating program or a file.

    It actually won't run forever because of a handy thing called EOF.

    Nice idea about the type sig, though.