|
|
@ -123,8 +123,8 @@ void triDichotomiqueFusion(ListeCandidats liste, int start, int end) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandidatTraite(Candidat candidat) {
|
|
|
|
void afficherCandidatTraite(Candidat candidat) {
|
|
|
|
printf("Candidat n°%d, '%s %s' :"
|
|
|
|
printf("\tCandidat n°%d, '%s %s' :"
|
|
|
|
"\n - Note globale : %f\n\n",
|
|
|
|
"\n\t - Note globale : %.2f\n\n",
|
|
|
|
candidat.id, candidat.prenom, candidat.nom,
|
|
|
|
candidat.id, candidat.prenom, candidat.nom,
|
|
|
|
candidat.noteGlobale);
|
|
|
|
candidat.noteGlobale);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -152,7 +152,8 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
|
|
|
|
|
|
|
|
if(strcasecmp(candidature->ville, ville) == 0)
|
|
|
|
if(strcasecmp(candidature->ville, ville) == 0)
|
|
|
|
if(strcasecmp(candidature->departement, dept) == 0)
|
|
|
|
if(strcasecmp(candidature->departement, dept) == 0)
|
|
|
|
listeCandidatsMatch[nbCandidatsMatch++] = liste[i];
|
|
|
|
if(candidature->decision == 0)
|
|
|
|
|
|
|
|
listeCandidatsMatch[nbCandidatsMatch++] = liste[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -177,8 +178,14 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
|
|
|
|
|
|
|
|
listeAttente[nbAttente++] = *listeCandidatsMatch[i];
|
|
|
|
listeAttente[nbAttente++] = *listeCandidatsMatch[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
} else {
|
|
|
|
|
|
|
|
for(j=0; j<listeCandidatsMatch[i]->nbCandidatures; j++)
|
|
|
|
|
|
|
|
if(strcasecmp(listeCandidatsMatch[i]->listeCandidatures[j]->ville, ville) == 0)
|
|
|
|
|
|
|
|
if(strcasecmp(listeCandidatsMatch[i]->listeCandidatures[j]->departement, dept) == 0)
|
|
|
|
|
|
|
|
listeCandidatsMatch[i]->listeCandidatures[j]->decision = -1;
|
|
|
|
|
|
|
|
|
|
|
|
listeRefuses[nbRefuse++] = *listeCandidatsMatch[i];
|
|
|
|
listeRefuses[nbRefuse++] = *listeCandidatsMatch[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(fNameAdmis, "donnees/");
|
|
|
|
strcpy(fNameAdmis, "donnees/");
|
|
|
@ -194,9 +201,8 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
exit(errno);
|
|
|
|
exit(errno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
printf("\nCandidats acceptés :\n");
|
|
|
|
printf("\n\n\e[4;37mCandidats acceptés :\e[0m\n\n");
|
|
|
|
for(i=0; i<nbAdmis; i++) {
|
|
|
|
for(i=0; i<nbAdmis; i++) {
|
|
|
|
printf("\n%d sur %d : \n\n", i+1, nbCandidatsAccept);
|
|
|
|
|
|
|
|
afficherCandidatTraite(listeAdmis[i]);
|
|
|
|
afficherCandidatTraite(listeAdmis[i]);
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
|
|
|
@ -210,7 +216,7 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
fclose(fAdmis);
|
|
|
|
fclose(fAdmis);
|
|
|
|
|
|
|
|
|
|
|
|
if(nbAdmis == 0)
|
|
|
|
if(nbAdmis == 0)
|
|
|
|
printf("\tAucun candidat accepté.\n");
|
|
|
|
printf("\tAucun candidat accepté.\n\n");
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(fNameAttente, "donnees/");
|
|
|
|
strcpy(fNameAttente, "donnees/");
|
|
|
|
strcat(fNameAttente, ville);
|
|
|
|
strcat(fNameAttente, ville);
|
|
|
@ -225,7 +231,7 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
exit(errno);
|
|
|
|
exit(errno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
printf("Candidats en liste d'attente :\n\n");
|
|
|
|
printf("\e[4;37mCandidats en liste d'attente :\e[0m\n\n");
|
|
|
|
for(i=0; i<nbAttente; i++) {
|
|
|
|
for(i=0; i<nbAttente; i++) {
|
|
|
|
afficherCandidatTraite(listeAttente[i]);
|
|
|
|
afficherCandidatTraite(listeAttente[i]);
|
|
|
|
printf("\n\n");
|
|
|
|
printf("\n\n");
|
|
|
@ -240,16 +246,19 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
fclose(fAttente);
|
|
|
|
fclose(fAttente);
|
|
|
|
|
|
|
|
|
|
|
|
if(nbAttente == 0)
|
|
|
|
if(nbAttente == 0)
|
|
|
|
printf("\tAucun candidat en liste d'attente.\n");
|
|
|
|
printf("\tAucun candidat en liste d'attente.\n\n");
|
|
|
|
|
|
|
|
|
|
|
|
printf("Candidats refusés :\n\n");
|
|
|
|
printf("\e[4;37mCandidats refusés :\e[0m\n\n");
|
|
|
|
for(i=0; i<nbRefuse; i++) {
|
|
|
|
for(i=0; i<nbRefuse; i++) {
|
|
|
|
afficherCandidatTraite(listeRefuses[i]);
|
|
|
|
afficherCandidatTraite(listeRefuses[i]);
|
|
|
|
printf("\n\n");
|
|
|
|
printf("\n\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(nbRefuse == 0)
|
|
|
|
if(nbRefuse == 0)
|
|
|
|
printf("\tAucun candidat refusé.\n");
|
|
|
|
printf("\tAucun candidat refusé.\n\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("\e[1;32m%d candidats ont été admis, %d mis en file d'attente et %d refusés.\n\n\e[0m",
|
|
|
|
|
|
|
|
nbAdmis, nbAttente, nbRefuse);
|
|
|
|
|
|
|
|
|
|
|
|
free(listeCandidatsMatch);
|
|
|
|
free(listeCandidatsMatch);
|
|
|
|
}
|
|
|
|
}
|