#include<stdio.h> #include<stdlib.h> #define N 10 int M[N+1][N+1];//M déclarée globale unsigned long fact_recursive (unsigned short nombre) { if (nombre == 0) return 1; else return nombre * fact_recursive(nombre - 1); } int triangle(int b) { int i,k=1,j; for(i=0;i<b;i++) { for(j=0;j<=i;j++) { k=fact_recursive(i)/(fact_recursive(j)*fact_recursive(i-j)); printf("%4d\t",k); //mémoriser dans M M[i][j]=k; } printf("\n"); } } int main() { triangle(N); return 0; } |
Please disable your ad blocker and refresh the window to use this website.