hi,
Looking from the input format you have given,
you will have to do some text processing. I mean if you go with getline(), then after you have read a line, then you need to get the individual strings from the line and convert them to integers. It can be done and you need to figure this part out yourself.
An STL conatiner would be able to help you with the storage part.
(what is STL)[
^]
Simply put you can read the input from the text file.
Then use a
std::map[
^] alongwith a
std::vector[
^].
The map you can use is
std::map<int,std::vector<int>>
so the key stores the number of integers in a row and the vector will store the actual integer values.
Then use iterators for traversing through the map instead of raw loops.
This might save you from 're-inventing the wheel'
hope this helps !!