51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void){
|
|
int hauteur;
|
|
char lettre;
|
|
int etoile;
|
|
int a;
|
|
int i;
|
|
int b;
|
|
int d;
|
|
int e;
|
|
printf("t) Triangle \n");
|
|
printf("c) Carré \n");
|
|
printf("q) Quitter \n");
|
|
printf("Votre choix ? : ");
|
|
scanf("%c", lettre);
|
|
if (lettre == "t"){
|
|
printf("Hauteur ? : \n");
|
|
scanf("%d", hauteur)
|
|
etoile = 1
|
|
for(a = 0, a<=hauteur; a=a+1){
|
|
for(i = 0, i<etoile; i=i+1){
|
|
printf("*")
|
|
}
|
|
printf("\n")
|
|
}
|
|
}
|
|
if (lettre == "c"){
|
|
printf("Hauteur ? : \n");
|
|
scanf("%d", hauteur);
|
|
for (b=0, b<= hauteur, b=b+1){
|
|
printf("*");
|
|
}
|
|
printf("\n");
|
|
for (d=0, d <= hauteur-2 ; d=d+1){
|
|
printf("\n");
|
|
printf("*");
|
|
for (e=0,hauteur-2 ; e=e+1){
|
|
printf(" ");
|
|
}
|
|
printf("*");
|
|
}
|
|
}
|
|
if lettre == "q"{
|
|
printf("Au revoir...");
|
|
}
|
|
return EXIT_SUCCESS
|
|
}
|
|
|
|
|