Is there a way to pull any variable type from the input stream, and if the stream is empty then just skip it? I know about gets() but that does char arrays, I want to be able to do numbers. I'm trying to solve a few problems at a programming competition board, and the judge gives the program a long list of numbers in the stream like:
45 1003 24 1 19
19 24 145 111 1
432 123 51 4 4
etc....
An arbitrary amount numbers up to 10 are in each line and an arbitrary number of lines between 1 and 1000 are given and with no number like -1 to signal when the stream is done so I never know if 1 line or 1000 lines are in the stream. I REALLY don't want to use gets() and have to parse, that would really make me want to quit...![]()



LinkBack URL
About LinkBacks




Well, what can I say... thank you elad for mentioning "the extra input tacked to the end of the report"
Ok, I'll butt out now.