1#include <iostream>
2using namespace std;
3
4int main()
5{
6 int rows, coef = 1;
7
8 cout << "Enter number of rows: ";
9 cin >> rows;
10
11 for(int i = 0; i < rows; i++)
12 {
13 for(int space = 1; space <= rows-i; space++)
14 cout <<" ";
15
16 for(int j = 0; j <= i; j++)
17 {
18 if (j == 0 || i == 0)
19 coef = 1;
20 else
21 coef = coef*(i-j+1)/j;
22
23 cout << coef << " ";
24 }
25 cout << endl;
26 }
27
28 return 0;
29}