1 #include<iostream> 2 using namespace std; 3 4 int s[30][30] = { 0 }, max=1; 5 void setup(int n){ 6 if(n>max){ 7 for(int i=max;i<n;i++) 8 for(int j=1;j<=i+1;j++) 9 s[i][j]=s[i-1][j-1]+s[i-1][j]; 10 max=n; 11 return; 12 }else 13 return; 14 } 15 void output(int n){ 16 for(int i=0;i<n;i++){ 17 cout<<s[i][1]; 18 for(int j=2;j<=i+1;j++) 19 cout<<" "<<s[i][j]; 20 cout<<endl; 21 } 22 } 23 int main(){ 24 s[0][1]=1; 25 int n; 26 while(cin>>n&&n){ 27 setup(n); 28 output(n); 29 cout << endl; 30 } 31 return 0; 32 }