You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
1.8 KiB
138 lines
1.8 KiB
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "commun.h"
|
|
|
|
|
|
##########################TABLEAU POINTEUR#####################################################
|
|
Choix lirechx (void){
|
|
Choix chx;
|
|
|
|
printf("Saisir le choix de la ville \n");
|
|
fgets(chx.ville, 20, stdin);
|
|
chx.ville[strlen(chx.ville)-1]= '\0';
|
|
|
|
printf("Saisir le choix du departement d'étude\n");
|
|
fgets(chx.dptmt, 20, stdin);
|
|
chx.dptmt[strlen(chx.dptmt)-1]= '\0';
|
|
|
|
chx.dec = 0;
|
|
chx.valid = 0;
|
|
return chx;
|
|
}
|
|
|
|
|
|
|
|
Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier
|
|
{
|
|
Candidat c;
|
|
printf("Numéro de candidat :\n");
|
|
scanf("%d%*c", &c.nEtu);
|
|
printf("Nom du candidat :\n");
|
|
fgets(c.nom, 20, stdin);
|
|
printf("Prénom du candidat :\n");
|
|
fgets(c.prenom, 20, stdin);
|
|
printf("Moyenne de maths :\n");
|
|
scanf("%f", &c.moymat);
|
|
printf("Moyenne de français :\n");
|
|
scanf("%f", &c.moyfr);
|
|
printf("Moyenne d'anglais :\n");
|
|
scanf("%f", &c.moyen);
|
|
printf("Moyenne de spécialité au choix :\n");
|
|
scanf("%f", &c.moyspe);
|
|
printf("Nombre de choix :\n");
|
|
scanf("%d%*c", &c.nbchx);
|
|
return c;
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){
|
|
|
|
}
|
|
*/
|
|
|
|
|
|
|
|
|
|
void AffC(Candidat c)
|
|
{
|
|
printf("%d\n", c.nEtu);
|
|
printf("%s \n %s\n", c.nom, c.prenom);
|
|
printf("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe);
|
|
printf("%d\n", c.nbchx);
|
|
}
|
|
|
|
|
|
|
|
|
|
######################################### LISTES ##########################################
|
|
|
|
|
|
|
|
void AffListeCandidat (Liste l){
|
|
if ( l == NULL) return;
|
|
AffC(l->ON A PAS ENCORE STRUCT)
|
|
|
|
AffListeCandidat(l->suivant);
|
|
}
|
|
|
|
Liste recherche (Liste l, char *nom ){
|
|
if ( l == NULL ){ return l;}
|
|
if ( strcmp ( l->Candidat.nom, nom ) == 0) return l;
|
|
return recherche (l->suivant, nom );
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################### FILES ################################################# |