#include<iostream> #include<vector> using namespace std; vector<int>a(1,1); vector<int>print(vector<int>s){ vector<int>ans; s.insert(s.begin(),0);//补0 s.insert(s.end(),0);// for(int i=0;i<s.size()-1;i++){ ans.push_back(s[i]+s[i+1]);//等于前一行相邻两数之和 } return ans; } int main(){ int n; scanf("%d",&n); printf("%5d\n",1); if(n==1)return 0; else{ int j=1; vector<int>b(a); while(j<n){ vector<int>x=print(b); for(int i=0;i<x.size();i++){ if(i==0)printf("%5d",x[i]); else printf("%5d",x[i]); } printf("\n"); j++; b=x; } } return 0; }