Given a file with a random number of lines and each line consists of a random number of integers. For example : 155 779 588 883 974 789 9533 345 534 Store all numbers in each line into a vector of integers. Then you print out the contents of the vectors. Expected output : Vector 1 : 155, 779, 588 Vector 2 : 883, 974, 789, 9533 Vector 3 : 345, 534 Another example : 255 999 755 143 633 247 884 335 993 566 100 633 124 755 332 624 825 Expected output : Vector 1 : 255, 999, 755, 143, 633, 247 Vector 2 : 884, 335 Vector 3 : 993, 566, 100, 633 Vector 4 : 124, 755, 332, 624, 825 Please note that the number of lines may be unlimited and the number of integers for each line may be also unlimited. |
|
|
255 999 755 143 633 247 884 335 993 566 100 633 124 755 332 624 825 |
|
|
OUTPUT: Vector 1: 255 999 755 143 633 247 Vector 2: 884 335 Vector 3: 993 566 100 633 Vector 4: 124 755 332 624 825 |
if the file is open push_back this std::vector<int> into the holding container |