diff --git a/sae b/sae index 4c1c428..664ca0d 100755 Binary files a/sae and b/sae differ diff --git a/sae1-02.c b/sae1-02.c index 022f442..b161348 100644 --- a/sae1-02.c +++ b/sae1-02.c @@ -109,7 +109,7 @@ listetuinfo lireEtu(FILE *fe){ } */ -Listchoixdept ensemblevide(void){return NULL;} +Listchoixdept listvide(void){return NULL;} Listchoixdept lireCarte(FILE *fe, int nbchoix){ if(nbchoix==0){return NULL;} @@ -135,7 +135,7 @@ int chargeretudiant(char nomFich[], listetuinfo *tetu[], int tmax){ fe = fopen( nomFich, "r"); if(fe==NULL){printf("\n");return-1;} fscanf(fe, "%d", &nbetu); - b = ensemblevide(); + b = listvide(); for(i=0; i");fclose(fe);return-1;} tetu[i] = (listetuinfo*)malloc(sizeof(listetuinfo)); @@ -150,35 +150,36 @@ int chargeretudiant(char nomFich[], listetuinfo *tetu[], int tmax){ } void affichage(Listchoixdept c){ - if(c==NULL){printf("}\n");return;} + if(c==NULL){printf("\n");return;} printf("%s %s %d %d", c->Ville, c->dep, c->decision, c->validation); if(c->suivant==NULL){affichage(c->suivant);} else{ - printf(","); + printf("\n -"); affichage(c->suivant); } } void affichageetu(listetuinfo a){ - printf("%d\n%s %s\n", a.numeroetu, a.nometu, a.prenometu); - printf("mathématique : %d\n", a.notes[0]); - printf("français : %d\n", a.notes[1]); - printf("anglais : %d\n", a.notes[2]); - printf("matière spé : %d\n", a.notes[3]); + printf(" %d\n %s %s\n", a.numeroetu, a.nometu, a.prenometu); + printf(" mathématique : %d\n", a.notes[0]); + printf(" français : %d\n", a.notes[1]); + printf(" anglais : %d\n", a.notes[2]); + printf(" matière spé : %d\n", a.notes[3]); } void test1(void){ listetuinfo *tetu[5000]; + Listchoixdept b; + b = listvide(); int j, i, nb; char nomFich[20]; strcpy( nomFich, "candidature.txt"); nb = chargeretudiant(nomFich, tetu, 5000); for(j=0; jnbchoix; i++){ - printf("carte %d={", i+1); - affichage(*tetu[j]->carte); - }*/ + printf("tout les choix : \n -", i+1); + b = tetu[j]->carte; + affichage(b); + printf("\n\n"); } }