热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_70660792
哈利。波特
4 年前
trueweixin_70660792

#include<iostream>
using namespace std;
int main(){
int a,b[22][22]={};
cin>>a;
b[1][1]=1;
cout<<"1"<<endl;
for(int i=2;i<=a;i++){
for(int j=1;j<=i;j++){
b[i][j]=b[i-1][j]+b[i-1][j-1];
cout<<b[i][j]<<" ";
}
cout<<endl;
}
return 0;
}
c++实现杨辉三角形

CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
https://blog.csdn.net/qq_35726680/article/details/125971756小程序开发指南-TS封装wx.request
立即登录