How should I read this file if I know how many int values are after the first value but I don't know how many values are after them. My problem is when I have to read the lines that contains 2 values.

**Edit: This is my file**

```
5
27
15
42
17
35
20 1
28 2
43 3

```

Here is what I tried:

```
fin >> n;
for (i=1; i<=n; i++)
    fin >> part[i];

while(!fin.eof())
{
    nrT++;
    fin >> tric[nrT][0];
    fin >> tric[nrT][1];
}

```