提交时间:2024-05-25 15:28:21
运行 ID: 148994
#include<iostream> using namespace std; int a[16][16]; int main(){ int n; cin>>n; a[1][1]=1; cout<<1<<endl; for(int i=2;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; } return 0; }