#include <iostream> #include <string> using namespace std; int main() { int n; int a[31][31]; for (int i = 1; i <= 30; i++) { a[i][1] = 1; a[i][i] = 1; } for (int i = 3; i <= 30; i++) { for (int j = 2; j < i; j++) { a[i][j] = a[i - 1][j - 1] + a[i - 1][j]; } } while (cin >> n) { for (int i = 1; i <= n; i++) { for (int j = 1; j < i; j++) { cout << a[i][j] << " "; } cout << a[i][i] << endl; } cout << endl; } }