Hello everyone,
I have to submit code to one of the problems in ACM IPC and, as you may know, the time counts a lot. So, I have to read efficiently an input like this: The first line will contain the sequence of integer values associated and the second line will contain the sequence of integer values associated with another sequence. E.g.:
3 2 1 4 5 7 6
3 1 2 5 6 7 4
7 8 11 3 5 16 12 18
8 3 11 7 16 18 12 5
255
255
I have to put the 1st line in an array and the second in another and pass both in a function.
How do I read and put these in C/C++? I was thinking in a C way, but my approach would have 2 while's... I have preference reading with scanf, but the parsing can be done as you want.
Please , help this newb!