Files
Anglish
BD
DEV
DEV1.1
CM1
CM3
TP01
TP02Entiers
TP_Boucles
TP_Boucles2
TP_Caracteres
TP_ChainesDeCaracteres
TP_Debogueur
TP_Fonctions
TP_Math
TP_OrganisationCode
TP_Reels
TP_Tableau
TP_TableauMultidimentionel
exe
q3.c
q3.c~
q4.c
q4.c~
TP_Types
TP_adresses
Tp_Math
wamster_CM1.tar.gz
wamster_CM3.tar.gz
DEV1.1_suite
DEV2.1
DEV2.3
DEV3.1
DEV3.2
DEV_Madelaine
DEV_William
EC
Math
PHP
SAE
SCR
rien
BUT2/DEV/DEV1.1/TP_TableauMultidimentionel/q3.c

29 lines
768 B
C
Raw Normal View History

2023-10-23 13:23:36 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int trianglePascal[16][16];
int ligne=0;
int colone =0;
for(ligne=0;ligne<16;ligne++){
for (colone=0;colone<16;colone++){
trianglePascal[ligne][colone]=0;
}
}
printf("\n");
trianglePascal[0][0]=1;
printf("%5d",trianglePascal[0][0]);
for (ligne=1;ligne<15;ligne++){
printf("\n");
trianglePascal[ligne][0]=1;
printf("%5d",trianglePascal[ligne][0]);
colone=1;
while(trianglePascal[ligne-1][colone-1] + trianglePascal[ligne-1][colone]!=0){
trianglePascal[ligne][colone]= trianglePascal[ligne-1][colone-1] + trianglePascal[ligne-1][colone];
printf("%5d",trianglePascal[ligne][colone]);
colone++;
}
}
printf("\n");
return EXIT_SUCCESS;
}