Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
11829 | 蒋瀚辉 | C语言7.13 | C++ | Accepted | 2 MS | 728 KB | 334 | 2021-05-17 19:16:29 |
#include <bits/stdc++.h> using namespace std; int a[25][25],n; int main() { cin >> n; for(int i=1;i<=n;i++) a[i][1]=1; for(int i=2;i<=n;i++) for(int j=2;j<=i;j++) a[i][j]=a[i-1][j]+a[i-1][j-1]; for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) cout << a[i][j] << " "; cout << endl; } return 0; }