25 lines
683 B
C
25 lines
683 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
int main(void) {
|
||
|
int trianglePascal[15][15];
|
||
|
int ligne=0;
|
||
|
int colone =0;
|
||
|
for(ligne=0;ligne<15;ligne++){
|
||
|
for (colone=0;colone<15;colone++){
|
||
|
trianglePascal[ligne][colone]=0;
|
||
|
}
|
||
|
}
|
||
|
for (ligne=0;ligne<15;ligne++){
|
||
|
printf("\n");
|
||
|
trianglePascal[ligne][0]=1;
|
||
|
printf("%4d",trianglePascal[ligne][0]);
|
||
|
ligne++;
|
||
|
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("%4d",trianglePascal[ligne][colone]);
|
||
|
colone++;
|
||
|
}
|
||
|
}
|
||
|
return EXIT_SUCCESS;
|