Files
python/TangDou/Output/O11.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

20 lines
411 B
C++

#include <bits/stdc++.h>
using namespace std;
const int N = 8;
int a[N][N];
int main() {
int i, j;
int n;
cin>>n;
for (i = 0; i <= n - 1; i++) {
for (j = 0; j <= i; j++) {
if (j == 0 || j == i) a[i][j] = 1;
else a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}