|
|
|
@ -74,18 +74,41 @@ charger -- recup :
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Listchoixdept lireChoix(FILE *fe, int nbchoix){
|
|
|
|
|
Listchoixdept listchoixdeptvide(void){
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Listchoixdept inserercarte(Listchoixdept c, FILE fe){
|
|
|
|
|
Maillonchoix cc;
|
|
|
|
|
cc = (Maillonchoix*)malloc(sizeof(Maillonchoix));
|
|
|
|
|
if(cc==NULL){printf("<! pb malloc in ajoutercarte !>\n");exit(1);}
|
|
|
|
|
fscanf(fe, "%s %s %d %d", cc.Ville, cc.dep, &cc.decision, &cc.validation);
|
|
|
|
|
cc->suivant=c;
|
|
|
|
|
return cc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Listchoixdept lireChoix(FILE *fe, int nbchoix){
|
|
|
|
|
int i=0;
|
|
|
|
|
int decision, validation;
|
|
|
|
|
char Ville[21], dep[21];
|
|
|
|
|
Listchoixdept c, temp;
|
|
|
|
|
c = listchoixdeptvide();
|
|
|
|
|
for(i=0; i<nbchoix; i++){
|
|
|
|
|
c = inserercarte(c, fe);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listetuinfo lireEtu(FILE *fe){
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
listetuinfo b;
|
|
|
|
|
fscanf(fe, "%d %s %s %d %d %d %d %d", &b.numeroetu, b.nometu, b.prenometu, &b.notes[0], &b.notes[1], &b.notes[2], &b.notes[3], &b.nbchoix);
|
|
|
|
|
*b.lchoixdept = lireChoix(fe, b.nbchoix);
|
|
|
|
|
return b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int chargeretudiant(char nomFich[], listetuinfo *tetu[]){
|
|
|
|
|
|
|
|
|
|
int i=0, nbetu;
|
|
|
|
|
listetuinfo a;
|
|
|
|
|
FILE *fe;
|
|
|
|
@ -101,8 +124,28 @@ int chargeretudiant(char nomFich[], listetuinfo *tetu[]){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test1(void){
|
|
|
|
|
void affichage(Listchoixdept c){
|
|
|
|
|
if(e==NULL){printf("}\n");return;}
|
|
|
|
|
printf("%s %s %d %d", c.Ville, c.dep, c.decision, c.validation);
|
|
|
|
|
if(e->suivant==NULL){affichageensemble(e->suivant);}
|
|
|
|
|
else{
|
|
|
|
|
printf(",");
|
|
|
|
|
affichageensemble(e->suivant);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test1(void){
|
|
|
|
|
listetuinfo *tetu[5000];
|
|
|
|
|
int j,i, nb;
|
|
|
|
|
char nomFich[31];
|
|
|
|
|
strcpy(nomFich, "candidature.txt");
|
|
|
|
|
nb = chargeretudiant(nomFich, tetu);
|
|
|
|
|
for(j=0, j<nb, j++){
|
|
|
|
|
for(i=0, i<tetu[j].nbchoix, i++){
|
|
|
|
|
printf("carte %d={", i+1);
|
|
|
|
|
affichageensemble(tetu[j].lchoixdept);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|