Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
128979 daichenxi 杨辉三角 C++ 通过 100 0 MS 252 KB 306 2024-01-26 14:36:31

Tests(2/2):


#include <bits/stdc++.h> using namespace std; int c[105][105]; int main() { int n,m; cin>>n; c[0][0]=1; for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) c[i][j]=c[i-1][j]+c[i-1][j-1]; } for(int i=1;i<=n;i++,cout<<endl) for(int j=1;j<=i;j++) cout<<c[i][j]<<" "; return 0; }


测评信息: