APL/APL1.1/Dev1.1/Dev811/Découpage.c

47 lines
670 B
C
Raw Normal View History

2021-11-16 15:32:33 +01:00
#include <stdio.h>
#include <stdlib.h>
int carre(int h) {
int i;
printf ("*****\n");
for (i=0;i<=h;i++){
printf ("* *\n");
}
printf ("*****");
}
int triangle(int h){
int i;
for (i=0;i<=h;i++){
for (i=0;i<=h;i++){
printf("*");
}
printf("\n");
}
}
int main(void){
char choix;
int h;
printf(" t) Triangle\n");
printf(" c) Carré \n");
printf(" q) Quitter\n");
printf("Votre choix ? ");
scanf("%c",&choix);
if (choix = "q"){
return EXIT_SUCCESS;
}
if (choix = "c"){
printf("Hauteur \n");
scanf("%d",&h);
carre(h);
}
if (choix = "t") {
printf("Hauteur \n");
scanf("%d",&h);
triangle(h);
}
return EXIT_SUCCESS;
}