sums in triangle input

I am new to codechef and wanted to ask how to take input for the problem -> sums in a triangle problem

take the input in a multidimensional array. Take only 1 input for row 1, 2 for row 2, 3 for row 3. This can be easily done using a for loop.
for(int i=0; i<n; i++)
{
for(int j=0; j<(i+1); j++)
{
cin>>a[i]a[j];
}
}
thus this loop ensures that you take input into ā€˜nā€™ rows and for each row, u only take inputs equal to the row number.

//