Developpement/23DEV1.1/TPS1/TP01/12-Tableau/Tableau-Multidimensionnel/Triangle.c

22 lines
407 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#define CAPACITE 30
int main(void) {
int n, i, j;
int tab[CAPACITE][CAPACITE];
for (i = 0 ; i < CAPACITE ; i++){
for (j = 0 ; j != i ; j++){
if(j == 0 || j==i-1){
tab[i][j] = 1;
printf("%10d", tab[i][j]);
}
else{
tab[i][j] = tab[i-1][j-1] + tab[i-1][j];
printf("%10d", tab[i][j]);
}
}
printf("\n\n");
}
return EXIT_SUCCESS;
}