提交时间:2024-06-22 08:58:31
运行 ID: 152052
#include <bits/stdc++.h> using namespace std; int a[16][16]; int main() { a[1][1] = 1; int n; cin >> n; cout << "1\n"; for (int i = 2; i <= n; i++) { for (int j = 1; j <= i; j++) a[i][j] = a[i - 1][j] + a[i - 1][j - 1], cout << a[i][j] << " "; cout << endl; } }