Run ID:152722
提交时间:2026-05-01 20:43:26
#include <iostream> using namespace std; long long a[35]; int main() { int n; cin >> n; a[1] = 1; cout << "1" << endl; for (int i = 2; i <= n; i++) { for (int j = i; j >= 2; j--) { a[j] = a[j-1] + a[j]; } a[1] = 1; for (int j = 1; j <= i; j++) { cout << a[j]; if (j < i) { cout << " "; } } cout << endl; } return 0; }