#include<bits/stdc++.h> using namespace std; int a[200][200]; int n,c=1; int main() { cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(i+j==n+1){ a[i][j]=j; } else if(i+j>=n+2){ a[i][j]=a[i-1][j]+a[i][j-1]; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(a[i][j]==0){ cout<<setw(5)<<" "; } else{ cout<<setw(5)<<a[i][j]; } } cout<<endl; } return 0; } /************************************************************** Problem: 1207 User: wangzherongyao Language: C++ Result: Accepted Time:10 ms Memory:2228 kb ****************************************************************/