题解
2025-03-05 19:19:43
发布于:广东
5阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int b;
long long a[666][666];
int main(){
cin>>b;
for(int i=1;i<=b;i++){
for(int j=1;j<=i;j++){
if(j==1||j==i)a[i][j]=1;
else{
a[i][j]=a[i-1][j-1]+a[i-1][j];
}
}
}for(int i=1;i<=b;i++){
for(int j=1;j<=i;j++){
cout<<a[i][j]<<' ';
}
cout<<endl;
}
return 0;
}
这里空空如也
有帮助,赞一个