From 6b37ebd139ff2a00a9d9b81d30dd74df9ed9f566 Mon Sep 17 00:00:00 2001 From: Lola CHALMIN Date: Tue, 13 Dec 2022 15:26:19 +0100 Subject: [PATCH 1/2] ca c'est fait --- commun.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/commun.h b/commun.h index d41cbd2..2cba41a 100644 --- a/commun.h +++ b/commun.h @@ -9,21 +9,21 @@ */ typedef struct { - int nEtu; - char nom[20]; - char prenom[20]; - float moymat; - float moyfr; - float moyen; - float moyspe; - int nbchx; + int nEtu;//numéro d'étudiant + char nom[20];//nom de l'étudiant + char prenom[20];//prénom de l'étudiant + float moymat;//moyenne en maths + float moyfr;//moyenne en français + float moyen;//moyenne en anglais + float moyspe;//moyenne en spécialité + int nbchx;//nombre de choix }Candidat; typedef struct { - char ville[20]; - char dptmt[20]; - int dec; - int valid; + char ville[20];//ville choisie + char dptmt[20];//département choisi + int dec;//décision du choix + int valid;//validation du candidat }Choix; From a5955171bf9c365f184ce801438713c97d7e073b Mon Sep 17 00:00:00 2001 From: Lola CHALMIN Date: Tue, 13 Dec 2022 15:55:24 +0100 Subject: [PATCH 2/2] lirecandidat --- commun.c | 20 +++++++++++++++++++- commun.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/commun.c b/commun.c index e6d90a1..229e21c 100644 --- a/commun.c +++ b/commun.c @@ -4,5 +4,23 @@ #include "commun.h" - +Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier +{ + printf("Numéro de candidat :\n"); + scanf("%d", &nEtu); + printf("Nom du candidat :\n"); + fgets(); + printf("Prénom du candidat :\n"); + fgets(); + printf("Moyenne de maths :\n"); + scanf("%f", &moymat); + printf("Moyenne de français :\n"); + scanf("%f", &moyfr); + printf("Moyenne d'anglais :\n"); + scanf("%f", &moyen); + printf("Moyenne de spécialité au choix :\n"); + scanf("%f", &moyspe); + printf("Nombre de choix :\n"); + scanf("%d", nbchx); +} diff --git a/commun.h b/commun.h index 2cba41a..9bc314f 100644 --- a/commun.h +++ b/commun.h @@ -28,3 +28,4 @@ typedef struct { +Candidat lireCandidat(void); \ No newline at end of file