27 Septembre
This commit is contained in:
parent
1e063977ab
commit
68f7eec7b9
Binary file not shown.
@ -1,6 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
Binary file not shown.
25
DEV1.1/TP04:Types/affluence.c
Normal file
25
DEV1.1/TP04:Types/affluence.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
11
DEV1.1/TP04:Types/debordement.c
Normal file
11
DEV1.1/TP04:Types/debordement.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
31
DEV1.1/TP04:Types/monnaie.c
Normal file
31
DEV1.1/TP04:Types/monnaie.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
6
DEV1.1/TP04:Types/variete.c
Normal file
6
DEV1.1/TP04:Types/variete.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%d,77,%f,%c%c,%lf\n",77,77.0,'7','7',77.0);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user