#include <iostream>
using std::cout;
using std::endl;
int main()
{
int i;
int j = 0;
int num = 2;
int decrementOffset = 0;
int counter = 1;
for(i = 1; i < 6; i++)
{
for(j = i; j < num; j++)
{
///If the loop is on the second row or higher
if(i > 1)
{
///If the value of J is the highest for that row, start decrmenting
if(j >= num - counter)
{
decrementOffset += 2;
}
}
cout<<j-decrementOffset;
counter += 1;
}
cout<<endl;
num += 3;///increases the length of the row each loop
///resets variables
decrementOffset = 0;
counter = 0;
}
}