28 lines
590 B
C
28 lines
590 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int main(void){
|
||
|
int hauteur;
|
||
|
int i;
|
||
|
int a;
|
||
|
int b;
|
||
|
int espace;
|
||
|
int etoile;
|
||
|
printf("Hauteur de l'arbre :");
|
||
|
scanf("%d", &hauteur);
|
||
|
int acc=hauteur-1;
|
||
|
espace = hauteur-1;
|
||
|
etoile = 1;
|
||
|
for(i = hauteur ; i >= 0 ; i = i-1){
|
||
|
for(b = 0; b <= espace ; b = b+1){
|
||
|
printf(" ");
|
||
|
}
|
||
|
for(a = 0; a < etoile; a= a+1){
|
||
|
printf("*");
|
||
|
}
|
||
|
printf("\n");
|
||
|
espace=espace-1;
|
||
|
etoile=etoile+2;
|
||
|
}
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|