11 Octobre

This commit is contained in:
Adrian POURCHOT 2022-10-11 11:28:13 +02:00
parent 8f64f6143a
commit 965589da20
4 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
int r;
printf("Veuillez saisir un rayon : ");
scanf("%d"&r);
return 0;
}

View File

@ -0,0 +1,29 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
int a;
int b;
int c;
int d;
int e;
printf("Veuillez saisir 2 entiers naturels : ");
scanf("%d",&a);
scanf(" %d",&b);
if (b>a){
c=a;
a=b;
b=c;
}if(b==0){
printf("Le pgcd entre %d et %d est de %d\n",a,b,a);
}else{
d=a;
e=b;
while(d!=0&&e!=0){
c=d;
d=e;
e=c%e;
} printf("Le pgcd entre %d et %d est de %d\n",a,b,d);
}
return 0;
}

View File

@ -20,7 +20,30 @@ int main() {
printf("*");
} printf("\n");
}
}
} else{
if (n=='c'){
printf("Hauteur ? ");
scanf("%d",&h);
for (i=1;i<=h;i++){
for (j=1;j<=h;j++){
if (j==1||j==h){
printf("* ");
} else{
if (i==1||i==h){
printf("* ");
}else{
printf(" ");
}
}
}printf("\n");
}
}else{
if(n=='q'){
printf("Au revoir...\n\n");
break;
}
}
}
}
return 0;
}