Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
64228 | 杨宜炜 | 打印杨辉三角 | C++ | Accepted | 2 MS | 272 KB | 244 | 2024-01-21 09:25:11 |
#include<bits/stdc++.h> using namespace std; int a[30][31]; int main(){ a[0][1]=1; int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ a[i][j]=a[i-1][j-1]+a[i-1][j]; cout<<a[i][j]<<" "; } cout<<endl; } }