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

0 comments

No comments so far...