#include <iostream>using namespace std;
int main() {
int mat[30][30], n;
cin >> n;
for(int i = 1; i <= n; i++) { mat[n][i] = i; mat[i][1] = 1; }
for(int i = n-1; i >= 1; i--) { for(int j = 2; j <= n; j++) { mat[i][j]= mat[i+1][j] + mat[i][j-1]; } }
for(int i = 1; i <= n; i++) { for(int j = 1; j <= n; j++) { cout << mat[i][j] << " "; } cout << "\n"; }
}
Sper sa fie de folos :)