#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int n, m;

int DP[100][100];

void pascal(int x, int y){
    if (x >= n) return;
    if (y > x){
        printf("\n");
        pascal(x+1, 0);
        return;
    }
    if (y == 0 || y == x)
        DP[x][y] = 1;
    else
        DP[x][y] = DP[x-1][y-1] + DP[x-1][y];

    printf("%d ", DP[x][y]);
    
    pascal(x, y+1);
}

int main() {
    int a, b, s;
    scanf("%d", &n);
    m=n;

    pascal(0, 0);

    printf("\n");

    scanf("%d %d", &a, &b);
    s = a+b;

    printf("%d", DP[s][b]);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: