提交时间:2024-06-22 08:58:12

运行 ID: 152051

#include <bits/stdc++.h> using namespace std; int a[16][16]; int main() { a[1][1] = 1; int n; cin >> 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; } }