|
|
@ -125,12 +125,12 @@ void triDichotomiqueFusion(ListeCandidats liste, int start, int end) {
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandidatTraite(Candidat candidat) {
|
|
|
|
void afficherCandidatTraite(Candidat candidat) {
|
|
|
|
printf("\tCandidat n°%d, '%s %s' :"
|
|
|
|
printf("\tCandidat n°%d, '%s %s' :"
|
|
|
|
"\n\t - Note globale : %.2f\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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, int nbCandidats, int nbCandidatsAccept, float noteMini) {
|
|
|
|
void traiterCandidatures(ListeCandidats liste, int nbCandidats, int nbCandidatsAccept, float noteMini) {
|
|
|
|
int i, j, nbCandidatsMatch = 0;
|
|
|
|
int i, j, nbCandidatsMatch = 0;
|
|
|
|
char dept[LEN_MAX], ville[LEN_MAX], fNameAdmis[100], fNameAttente[100];
|
|
|
|
char dept[LEN_MAX], ville[LEN_MAX], fNameAdmis[100], fNameAttente[100];
|
|
|
|
FILE* fAdmis, *fAttente;
|
|
|
|
FILE* fAdmis, *fAttente;
|
|
|
@ -195,19 +195,22 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
strcat(fNameAdmis, dept);
|
|
|
|
strcat(fNameAdmis, dept);
|
|
|
|
strcat(fNameAdmis, "_Admis.don");
|
|
|
|
strcat(fNameAdmis, "_Admis.don");
|
|
|
|
|
|
|
|
|
|
|
|
fAdmis = fopen(fNameAdmis, "w");
|
|
|
|
fAdmis = fopen(fNameAdmis, "a");
|
|
|
|
|
|
|
|
|
|
|
|
if(fAdmis == NULL) {
|
|
|
|
if(fAdmis == NULL) {
|
|
|
|
perror("fopen");
|
|
|
|
perror("fopen");
|
|
|
|
exit(errno);
|
|
|
|
exit(errno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(nbAdmis > 0)
|
|
|
|
|
|
|
|
fprintf(fAdmis, "%d\n", nbAdmis);
|
|
|
|
|
|
|
|
|
|
|
|
printf("\n\n\e[4;37mCandidats acceptés :\e[0m\n\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++) {
|
|
|
|
afficherCandidatTraite(listeAdmis[i]);
|
|
|
|
afficherCandidatTraite(listeAdmis[i]);
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(fAdmis, "%s %s %.2f %.2f %.2f %.2f %.2f\n",
|
|
|
|
fprintf(fAdmis, "%s\n%s\n%.2f %.2f %.2f %.2f %.2f\n",
|
|
|
|
listeAdmis[i].nom, listeAdmis[i].prenom,
|
|
|
|
listeAdmis[i].nom, listeAdmis[i].prenom,
|
|
|
|
listeAdmis[i].moyenneMath, listeAdmis[i].moyenneFrancais,
|
|
|
|
listeAdmis[i].moyenneMath, listeAdmis[i].moyenneFrancais,
|
|
|
|
listeAdmis[i].moyenneAnglais, listeAdmis[i].moyenneSpecialite,
|
|
|
|
listeAdmis[i].moyenneAnglais, listeAdmis[i].moyenneSpecialite,
|
|
|
@ -225,19 +228,22 @@ void traiterCandidatures(VilleIUT** tiut, int nbVilles, ListeCandidats liste, in
|
|
|
|
strcat(fNameAttente, dept);
|
|
|
|
strcat(fNameAttente, dept);
|
|
|
|
strcat(fNameAttente, "_Attente.don");
|
|
|
|
strcat(fNameAttente, "_Attente.don");
|
|
|
|
|
|
|
|
|
|
|
|
fAttente = fopen(fNameAttente, "w");
|
|
|
|
fAttente = fopen(fNameAttente, "a");
|
|
|
|
|
|
|
|
|
|
|
|
if(fAttente == NULL) {
|
|
|
|
if(fAttente == NULL) {
|
|
|
|
perror("fopen");
|
|
|
|
perror("fopen");
|
|
|
|
exit(errno);
|
|
|
|
exit(errno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(nbAttente > 0)
|
|
|
|
|
|
|
|
fprintf(fAttente, "%d\n", nbAttente);
|
|
|
|
|
|
|
|
|
|
|
|
printf("\e[4;37mCandidats en liste d'attente :\e[0m\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");
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(fAttente, "%s %s %.2f %.2f %.2f %.2f %.2f\n",
|
|
|
|
fprintf(fAttente, "%s\n%s\n%.2f %.2f %.2f %.2f %.2f\n",
|
|
|
|
listeAttente[i].nom, listeAttente[i].prenom,
|
|
|
|
listeAttente[i].nom, listeAttente[i].prenom,
|
|
|
|
listeAttente[i].moyenneMath, listeAttente[i].moyenneFrancais,
|
|
|
|
listeAttente[i].moyenneMath, listeAttente[i].moyenneFrancais,
|
|
|
|
listeAttente[i].moyenneAnglais, listeAttente[i].moyenneSpecialite,
|
|
|
|
listeAttente[i].moyenneAnglais, listeAttente[i].moyenneSpecialite,
|
|
|
|