I made this code with a litte help but the task is to have exact number of columns(9) , and odd numbers need to be like this http://postimg.org/image/8ylp91bcf/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include "stdafx.h"
#include <iostream>
usingnamespace std;
int main() {
int n;
cin >> n;
if (n <= 0) return 0;
for (int r = 1; r <= n; r++) {
for (int c = 1; c <= r; c++) cout << r;
cout << endl;
}
return 0;
}