#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[21][21]={0};
	cin>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
			if(j==1||j==i) a[i][j]=1;
			else a[i][j]=a[i-1][j]+a[i-1][j-1];
		}
	}
	for(int l=1;l<=n;l++){
		for(int k=1;k<=l;k++){
			cout<<a[l][k]<<" ";
		}
		cout<<endl;
	}
}

0 comments

No comments so far...