From daa124b1f7cf74073283c9af3e4bdc97a5b5132c Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Wed, 14 Dec 2022 15:58:25 +0100 Subject: [PATCH] =?UTF-8?q?modif=20partie=201=20fct=20affiche=20et=20fichi?= =?UTF-8?q?er=20de=20donn=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- part2.c | 11 ++++++----- part2.h | 14 +++++++++++++- prout.don | 17 +++++++++++++++++ tpart1.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 prout.don diff --git a/part2.c b/part2.c index 50cea5d..2f9083d 100644 --- a/part2.c +++ b/part2.c @@ -5,7 +5,9 @@ ##########################TABLEAU POINTEUR##################################################### -Choix lirechx (void){ + + +Choix lirechx (void){//Fonction qui va lire les choix de la ville et du departement demandé par le candidat Choix chx; printf("Saisir le choix de la ville \n"); @@ -59,7 +61,6 @@ Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){ void AffC(Candidat c) { - printf("%d\n", c.nEtu); printf("%s \n %s\n", c.nom, c.prenom); printf("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe); printf("%d\n", c.nbchx); @@ -73,10 +74,10 @@ void AffC(Candidat c) void AffListeCandidat (Liste l){ + if ( l == NULL) return; - AffC(l->ON A PAS ENCORE STRUCT) - - AffListeCandidat(l->suivant); + AffC(l->cand); + AffListeCandidat(l->suivcand); } Liste recherche (Liste l, char *nom ){ diff --git a/part2.h b/part2.h index f1aa062..1347631 100644 --- a/part2.h +++ b/part2.h @@ -11,16 +11,23 @@ typedef struct { + int nEtu;//numéro d'étudiant char ville[20];//ville choisie char dptmt[20];//département choisi int dec;//décision du choix int valid;//validation du candidat }Choix; +typedef struct liste1{ + Choix chx; + struct list1 * suivchx; +}Maillon1; + +typedef Maillon1 * list1; + typedef struct { - 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 @@ -32,7 +39,12 @@ typedef struct { }Candidat; +typedef struct liste{ + Candidat cand; + struct liste * suivcand; +}Maillon; +typedef Maillon * Liste; Candidat lireCandidat(void); Choix lirechx (void); diff --git a/prout.don b/prout.don new file mode 100644 index 0000000..14578de --- /dev/null +++ b/prout.don @@ -0,0 +1,17 @@ +Grenoble 3 +Informatique 112 Dupont Jean +Bio-Informatique 116 Dupont Virginie +Biologie 124 Dupont Marie + +Clermont-Ferrand 2 +Informatique 136 Simon Carine +Biologie 154 Jean Claude + +Aurillac 2 +Biologie 102 Michèle Robert +Bio-Informatique 98 Claude Loeb + + + + + diff --git a/tpart1.c b/tpart1.c index 8bd8581..82b3b9a 100644 --- a/tpart1.c +++ b/tpart1.c @@ -2,3 +2,48 @@ #include #include #include"part1.h" + + + + + + + + + + + + + + + + + + + + + + + + + +void AfficheDpmt ( MaillonDept *dpt ){ + if ( dpt == NULL) return; + printf("%s %d %s ", dpt.departement, dpt.nbP, dpt.respAd); + AfficheDpmt(dpt->suiv);} + + + +void afficheIUT (VilleIUT *iut){ + printf ("%s ", iut->ville); + AfficheDpmt(iut->ldept); +} + + + +void Affichetableau(VilleIUT * TabIUT, int n ){ + int i; + + for ( i = 0 ; i < n ; i++ ) + afficheIUT(TabIUT[i]); +} \ No newline at end of file