diff --git a/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 b/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 deleted file mode 100755 index b1f7fee..0000000 Binary files a/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 and /dev/null differ diff --git a/DEV1.1/TP03:Conditions/bissextile.c b/DEV1.1/TP03:Conditions/bissextile.c index cb04c40..c02a22a 100644 --- a/DEV1.1/TP03:Conditions/bissextile.c +++ b/DEV1.1/TP03:Conditions/bissextile.c @@ -1,6 +1,17 @@ #include int main(void) { - - return 0; + int n; + printf("Veuillez saisir une annee.\n"); + scanf("%d",&n); + if (n%400==0){ + printf("%d est une annee bissextile.\n",n); + } else{ + if (n%4==0 && n%100!=0){ + printf("%d est une annee bissextile.\n",n); + } else { + printf("%d n'est pas une annee bissextile.\n",n); + } + } + return 0; } \ No newline at end of file diff --git a/DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 b/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 similarity index 57% rename from DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 rename to DEV1.1/TP04:Types/.nfs00000000005e220a00000065 index 0169f1e..29d9c02 100755 Binary files a/DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 and b/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 differ diff --git a/DEV1.1/TP04:Types/affluence.c b/DEV1.1/TP04:Types/affluence.c new file mode 100644 index 0000000..3c14f6a --- /dev/null +++ b/DEV1.1/TP04:Types/affluence.c @@ -0,0 +1,25 @@ +#include + +int main(void) { + int n; + int m; + m=0; + printf("Indiquez le nombre de visiteurs lundi.\n"); + scanf(" %d",&n); + m=m+n; + printf("Indiquez le nombre de visiteurs mardi.\n"); + scanf(" %d",&n); + m=m+n; + printf("Indiquez le nombre de visiteurs mercredi.\n"); + scanf(" %d",&n); + m=m+n; + printf("Indiquez le nombre de visiteurs jeudi.\n"); + scanf(" %d",&n); + m=m+n; + printf("Indiquez le nombre de visiteurs vendredi.\n"); + scanf(" %d",&n); + m=m+n; + m=m/5; + printf("Le nombre de visiteurs journalier moyen est de %d\n",m); + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP04:Types/debordement.c b/DEV1.1/TP04:Types/debordement.c new file mode 100644 index 0000000..4f071b8 --- /dev/null +++ b/DEV1.1/TP04:Types/debordement.c @@ -0,0 +1,11 @@ +#include + +int main(void) { + int n; + char c; + printf("Veuillez saisir un entier.\n"); + scanf("%d",&n); + c=n; + printf("%d,%c\n",n,c); + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP04:Types/monnaie.c b/DEV1.1/TP04:Types/monnaie.c new file mode 100644 index 0000000..0bfd157 --- /dev/null +++ b/DEV1.1/TP04:Types/monnaie.c @@ -0,0 +1,31 @@ +#include + +int main(void) { + float r; + int p1; + int p2; + int p3; + float ar; + float p; + p=5.49; + p1=0; + p2=0; + p3=0; + ar=0; + r=0; + printf("Veuillez saisir la monnaie donner par le client.\n"); + scanf("%f",&r); + ar=r-p; + while (ar>=2){ + ar=ar-2; + p1+=1; + } while (ar>=0.20){ + ar=ar-0.20; + p2+=1; + } while (ar>=0.01){ + ar=ar-0.01; + p3+=1; + } + printf("Pour rendre la monnaie, il faudra %d pieces de 2euros, %d pieces de 20centimes et %d pieces de 1centime.\n",p1,p2,p3); + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP04:Types/variete.c b/DEV1.1/TP04:Types/variete.c new file mode 100644 index 0000000..8692078 --- /dev/null +++ b/DEV1.1/TP04:Types/variete.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + printf("%d,77,%f,%c%c,%lf\n",77,77.0,'7','7',77.0); + return 0; +} \ No newline at end of file