diff --git a/commun.c b/commun.c index 1e9cd39..433fc7f 100644 --- a/commun.c +++ b/commun.c @@ -8,7 +8,7 @@ Choix lirechx (void){ Choix chx; - printf("Saisir le choix de la ville\n"); + printf("Saisir le choix de la ville \n"); fgets(chx.ville, 20, stdin); chx.ville[strlen(chx.ville)-1]= '\0'; @@ -42,7 +42,7 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier { Candidat c; printf("Numéro de candidat :\n"); - scanf("%d", &c.nEtu); + scanf("%d%*c", &c.nEtu); printf("Nom du candidat :\n"); fgets(c.nom, 20, stdin); printf("Prénom du candidat :\n"); @@ -56,12 +56,10 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier printf("Moyenne de spécialité au choix :\n"); scanf("%f", &c.moyspe); printf("Nombre de choix :\n"); - scanf("%d", &c.nbchx); - scanf("%d", nbchx); + scanf("%d%*c", &c.nbchx); return c; } -<<<<<<< HEAD @@ -88,15 +86,15 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier +/* Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){ } +*/ - -======= void AffC(Candidat c) { printf("%d\n", c.nEtu); @@ -104,4 +102,3 @@ void AffC(Candidat c) printf("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe); printf("%d\n", c.nbchx); } ->>>>>>> refs/remotes/origin/master diff --git a/commun.h b/commun.h index ab96e66..f1aa062 100644 --- a/commun.h +++ b/commun.h @@ -36,6 +36,7 @@ typedef struct { Candidat lireCandidat(void); Choix lirechx (void); +void AffC(Candidat c); diff --git a/test b/test new file mode 100755 index 0000000..7ef8ad3 Binary files /dev/null and b/test differ diff --git a/testcommun.c b/testcommun.c index 3dfde61..23fdde6 100644 --- a/testcommun.c +++ b/testcommun.c @@ -8,5 +8,8 @@ int main(void) { Candidat c; c = lireCandidat(); + AffC(c); + Choix chx; + chx = lirechx(); return 0; } \ No newline at end of file