I would use
std::vector
instead of
C
-like arrays.
For instance, the following program
#include<iostream>
#include <vector>
#include <sstream>
using namespace std;
using vint = vector<int>;
int main()
{
vector < vint > v = { vint{}, vint{}, vint{}, vint{}, vint{}, vint{} };
string line;
while ( getline(cin, line) )
{
istringstream iss(line);
for ( auto & x : v )
{
int i;
iss >> i;
x.push_back(i);
}
}
for (size_t n = 0; n < v.size(); ++n)
{
cout << "v[" << n << "] = ";
for ( auto i : v[n] )
{
cout << i << " ";
}
cout << "\n";
}
}
outputs
v[0] = 25 7 55 26 32 45 21 52 40 45 24 13 45 38 25
v[1] = 5 45 25 11 23 30 10 41 38 27 42 43 47 45 34
v[2] = 38 50 21 30 44 7 35 5 17 29 38 28 29 28 18
v[3] = 26 33 30 12 11 44 46 53 43 12 2 6 30 48 6
v[4] = 53 19 9 13 50 55 48 11 10 39 18 53 53 47 7
v[5] = 4 34 39 41 39 54 27 50 54 31 9 30 13 36 55
when fed with your input file (provided by standard input redirection).