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.
107 lines
2.5 KiB
107 lines
2.5 KiB
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* Partie 1 */
|
|
/**
|
|
* @brief Maillon d'une liste de départements
|
|
*
|
|
*/
|
|
typedef struct maillonDept
|
|
{
|
|
char departement[30];
|
|
int nbP;
|
|
char resp[30];
|
|
struct maillonDept *suiv;
|
|
} MaillonDept, *ListeDept;
|
|
|
|
/**
|
|
* @brief Structure d'une ville possédant un IUT
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
char ville[30];
|
|
ListeDept ldept;
|
|
} VilleIUT;
|
|
|
|
/* Partie 2 */
|
|
/**
|
|
* @brief Structure d'un choix
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
char ville[30];
|
|
char departement[30];
|
|
int decisionAdmission;
|
|
int decisionCandidat;
|
|
} Choix;
|
|
|
|
/**
|
|
* @brief Maillon d'une liste de choix
|
|
*
|
|
*/
|
|
typedef struct maillonChoix
|
|
{
|
|
Choix choix;
|
|
struct maillonChoix *suiv;
|
|
} MaillonChoix, *ListeChoix;
|
|
|
|
/**
|
|
* @brief Structure d'un candidat
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
int num;
|
|
char nom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
|
|
char prenom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
|
|
float tabNotes[5];
|
|
int nbChoix;
|
|
ListeChoix lChoix;
|
|
} Etudiant;
|
|
|
|
enum
|
|
{
|
|
maths,
|
|
francais,
|
|
anglais,
|
|
spe,
|
|
moy
|
|
};
|
|
|
|
/* ListeDept */
|
|
ListeDept listenouv(void);
|
|
ListeDept insererEnTete(ListeDept ld, char departement[], int nbP, char resp[]);
|
|
ListeDept inserer(ListeDept ld, char departement[], int nbP, char resp[]);
|
|
void afficher(ListeDept ld);
|
|
bool vide(ListeDept ld);
|
|
void afficherDept(ListeDept ld);
|
|
int rechercheDept(ListeDept ld, char departement[], bool *trouve);
|
|
ListeDept supprimerEnTete(ListeDept ld);
|
|
ListeDept supprimer(ListeDept ld, char departement[]);
|
|
int longueur(ListeDept ld);
|
|
int getNbP(ListeDept ld, int pos);
|
|
void setNbP(ListeDept ld, int pos, int valeur);
|
|
char *getResp(ListeDept ld, int pos);
|
|
void setResp(ListeDept ld, int pos, char valeur[]);
|
|
char *getDept(ListeDept ld, int pos);
|
|
void setResp(ListeDept ld, int pos, char valeur[]);
|
|
|
|
/* ListeChoix */
|
|
ListeChoix listenouvChoix(void);
|
|
ListeChoix insererEnTeteChoix(ListeChoix lc, Choix choix);
|
|
ListeChoix insererChoix(ListeChoix lc, Choix choix);
|
|
ListeChoix supprimerEnTeteChoix(ListeChoix lc);
|
|
ListeChoix supprimerChoix(ListeChoix lc, Choix choix);
|
|
bool rechercheChoix(ListeChoix lc, Choix choix);
|
|
Choix TeteChoix(ListeChoix lc);
|
|
bool videChoix(ListeChoix lc);
|
|
void afficherChoix(ListeChoix lc);
|
|
int longueurChoix(ListeChoix lc);
|
|
void afficherCandidatsChoix(Choix choix);
|
|
char *getDeptChoix(ListeChoix lc, int pos);
|
|
char *getVilleChoix(ListeChoix lc, int pos);
|
|
int trouverPos(ListeChoix lc, char ville[], char dept[]);
|
|
void setDecisionAdmission(ListeChoix lc, int pos, int val); |