#include <iostream>
using namespace std;
int main()
{
int n, i, j;
string s, c;
cout << "N = ";
cin >> n;
s = string(n, ' ');
for (i = 1; i <= n; i++) {
cout << "\n" << s;
s.erase(s.size() - 1);
for (j = 1; j <= i; j++) {
if (n <= 9)
c = " ";
else
c = i <= 9 ? " " : " ";
cout << c << i;
}
#include <iostream>
using namespace std;
int main()
{
int n, i, j;
string s, c;
cout << "N = ";
cin >> n;
s = string(n, ' ');
for (i = 1; i <= n; i++) {
cout << "\n" << s;
s.erase(s.size() - 1);
for (j = 1; j <= i; j++) {
if (n <= 9)
c = " ";
else
c = i <= 9 ? " " : " ";
cout << c << i;
}
}
}