1 solutions

  • 0
    @ 2025-2-11 23:44:00

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

    • 1

    Information

    ID
    1835
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    6
    Tags
    # Submissions
    19
    Accepted
    11
    Uploaded By