4 Octobre

This commit is contained in:
2022-10-04 17:58:52 +02:00
parent d4c676ea16
commit 8f64f6143a
7 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
char n;
int h;
int i;
int j;
int e;
int z=0;
while(z==0){
printf("_______________\nt) Triangle\nc) Carre\nq) Quitter\nVotre choix ? ");
scanf(" %c",&n);
if (n=='t'){
printf("Hauteur ? ");
scanf("%d",&h);
for (i=0;i<=h;i++){
for (j=h-i;j>0;j--){
} for (e=0;e<i;e++){
printf("*");
} printf("\n");
}
}
}
return 0;
}

View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
int h;
int i;
int j;
int e;
printf("Hauteur ? ");
scanf("%d",&h);
for (i=0;i<=h;i++){
for (j=h-i;j>0;j--){
printf(" ");
} for (e=0;e<(i*2)-1;e++){
printf("*");
} printf("\n");
}
return 0;
}