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

22 lines
407 B
C

#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;
}