modif partie 1 fct affiche et fichier de données

master
Roxane ROSSETTO 2 years ago
parent 5b12a2b082
commit daa124b1f7

@ -5,7 +5,9 @@
##########################TABLEAU POINTEUR##################################################### ##########################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; Choix chx;
printf("Saisir le choix de la ville \n"); printf("Saisir le choix de la ville \n");
@ -59,7 +61,6 @@ Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){
void AffC(Candidat c) void AffC(Candidat c)
{ {
printf("%d\n", c.nEtu);
printf("%s \n %s\n", c.nom, c.prenom); 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("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe);
printf("%d\n", c.nbchx); printf("%d\n", c.nbchx);
@ -73,10 +74,10 @@ void AffC(Candidat c)
void AffListeCandidat (Liste l){ void AffListeCandidat (Liste l){
if ( l == NULL) return; if ( l == NULL) return;
AffC(l->ON A PAS ENCORE STRUCT) AffC(l->cand);
AffListeCandidat(l->suivcand);
AffListeCandidat(l->suivant);
} }
Liste recherche (Liste l, char *nom ){ Liste recherche (Liste l, char *nom ){

@ -11,16 +11,23 @@
typedef struct { typedef struct {
int nEtu;//numéro d'étudiant
char ville[20];//ville choisie char ville[20];//ville choisie
char dptmt[20];//département choisi char dptmt[20];//département choisi
int dec;//décision du choix int dec;//décision du choix
int valid;//validation du candidat int valid;//validation du candidat
}Choix; }Choix;
typedef struct liste1{
Choix chx;
struct list1 * suivchx;
}Maillon1;
typedef Maillon1 * list1;
typedef struct { typedef struct {
int nEtu;//numéro d'étudiant
char nom[20];//nom de l'étudiant char nom[20];//nom de l'étudiant
char prenom[20];//prénom de l'étudiant char prenom[20];//prénom de l'étudiant
float moymat;//moyenne en maths float moymat;//moyenne en maths
@ -32,7 +39,12 @@ typedef struct {
}Candidat; }Candidat;
typedef struct liste{
Candidat cand;
struct liste * suivcand;
}Maillon;
typedef Maillon * Liste;
Candidat lireCandidat(void); Candidat lireCandidat(void);
Choix lirechx (void); Choix lirechx (void);

@ -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

@ -2,3 +2,48 @@
#include<stdlib.h> #include<stdlib.h>
#include<string.h> #include<string.h>
#include"part1.h" #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]);
}
Loading…
Cancel
Save