|
|
@ -50,7 +50,7 @@
|
|
|
|
void afficherEtudiant(Etudiant mEtudiant)
|
|
|
|
void afficherEtudiant(Etudiant mEtudiant)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
printf("%d\t%s\t%s\t%.2f\t%.2f\t%.2f\t%.2f\t%d\n", mEtudiant.num, mEtudiant.nom, mEtudiant.prenom, mEtudiant.tabMatiere[0], mEtudiant.tabMatiere[1], mEtudiant.tabMatiere[2], mEtudiant.tabMatiere[3], mEtudiant.nbChoix);
|
|
|
|
printf("%d\n%s\n%s\n%.2f\t%.2f\t%.2f\t%.2f\n%d\n", mEtudiant.num, mEtudiant.nom, mEtudiant.prenom, mEtudiant.tabMatiere[0], mEtudiant.tabMatiere[1], mEtudiant.tabMatiere[2], mEtudiant.tabMatiere[3], mEtudiant.nbChoix);
|
|
|
|
afficherChoix(mEtudiant.lChoix);
|
|
|
|
afficherChoix(mEtudiant.lChoix);
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -97,7 +97,7 @@ void afficherEtudiant(Etudiant mEtudiant)
|
|
|
|
|
|
|
|
|
|
|
|
// Regarder si le nombre de choix est = à 0 Que se passe-t-il ?
|
|
|
|
// Regarder si le nombre de choix est = à 0 Que se passe-t-il ?
|
|
|
|
|
|
|
|
|
|
|
|
int chargerCandidats(MaillonEtudiant *tetud[])
|
|
|
|
int chargerCandidats(Etudiant *tetud[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FILE *file;
|
|
|
|
FILE *file;
|
|
|
|
file = fopen("resultats.txt", "r");
|
|
|
|
file = fopen("resultats.txt", "r");
|
|
|
@ -111,18 +111,16 @@ int chargerCandidats(MaillonEtudiant *tetud[])
|
|
|
|
fscanf(file, "%d", &nbCandidats);
|
|
|
|
fscanf(file, "%d", &nbCandidats);
|
|
|
|
while (i < nbCandidats - 1)
|
|
|
|
while (i < nbCandidats - 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tetud[i] = (MaillonEtudiant *)malloc(sizeof(MaillonEtudiant));
|
|
|
|
tetud[i] = (Etudiant *)malloc(sizeof(Etudiant));
|
|
|
|
if (tetud[i] == NULL)
|
|
|
|
if (tetud[i] == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Erreur malloc");
|
|
|
|
printf("Erreur malloc");
|
|
|
|
exit(2);
|
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fscanf(file, "%d%s", &tetud[i]->num, tetud[i]->nom);
|
|
|
|
fscanf(file, "%d%s%s", &tetud[i]->num, tetud[i]->nom, tetud[i]->prenom);
|
|
|
|
fgets(tetud[i]->prenom, 22, file);
|
|
|
|
|
|
|
|
tetud[i]->prenom[strlen(tetud[i]->prenom - 1)] = '\0';
|
|
|
|
|
|
|
|
for (int note = 0; note < 4; note++)
|
|
|
|
for (int note = 0; note < 4; note++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fscanf(file, "%f", tetud[i]->tabMatiere[note]);
|
|
|
|
fscanf(file, "%f", &tetud[i]->tabMatiere[note]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fscanf(file, "%d", &tetud[i]->nbChoix);
|
|
|
|
fscanf(file, "%d", &tetud[i]->nbChoix);
|
|
|
|
tetud[i]->lChoix = listenouvChoix();
|
|
|
|
tetud[i]->lChoix = listenouvChoix();
|
|
|
|