diff --git a/sae.c b/sae.c new file mode 100644 index 0000000..df98a28 --- /dev/null +++ b/sae.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include"part1.h" + + +void global(void) +{ + int rep; + printf("๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ----------------------------------BIENVENUE--------------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ----------------------------SUR LE MENU D'ACCUEIL--------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ---------------------------------------------------------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ----------------------------Choisissez une option--------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ---------------------------------------------------------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ---------------------1-Informations sur les dรฉpartements-------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ---------------------------2-Phase de candidature--------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ------------------------3-Traitement des candidatures----------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ--------------------------4-Validation du candidat-------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ---------------------------------------------------------------------------๐ŸŽŸ๏ธ\n"); + printf("๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ๐ŸŽŸ๏ธ\n"); + scanf("%d", &rep); + if (rep == 1) + { + part1(); + } +} \ No newline at end of file diff --git a/sae.h b/sae.h new file mode 100644 index 0000000..a4c83c7 --- /dev/null +++ b/sae.h @@ -0,0 +1,193 @@ + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/*-------------------------------------------------------part1.h------------------------------------------------------*/ + + + + +typedef struct list{ + char departement[31];//le nom du dรฉpartement + int nbP;//nombre de places + char respAd[31];//nom du responsable + struct list * suiv;//pointeur suivant de la liste +}MaillonDept; + + +typedef struct{ + char ville[30];//nom de la ville + int nbDept;//nombre de dรฉpartements + MaillonDept * ldept;//liste de dรฉpartements +}VilleIUT; + +typedef MaillonDept * ListDept; + + +ListDept init(void);//fontion initialisation +MaillonDept lireM(FILE *f);//lire maillon +int Exists(char *st1, char *st2);// servira ร  trouver si le nom de la ville existe dรฉjร  donc il suffira d'ajouter un maillon ร  la chaรฎne +ListDept InsertT1(ListDept list, MaillonDept m);//Insert en tรชte de la liste +ListDept Insert1(ListDept list, MaillonDept m);//insert globalement +int Chargement(VilleIUT **tV, int tmax, char *nameFile);//charge le fichier dans le tableau +void AfficheDpmt ( MaillonDept *dpt );//Affiche un dรฉpartement d'une liste +void afficheIUT (VilleIUT *iut);//Affiche un iut avec ses dรฉpartements +void Affichetableau(VilleIUT ** TabIUT, int n );//Affiche le tableau des iuts avec leurs dรฉpartements +ListDept recherche (ListDept l, char *nom );//recherche du nom de dรฉpartement dans la liste +void MaJnbP(VilleIUT **tV, int nb);//mise ร  jour du nombre de places +int searchVille(VilleIUT ** tV, char *ville, int nbV);//recherche du nom de la ville dans le tableau +void createIUT(VilleIUT **tV, int nb);//crรฉe un IUT dans la ville souhaitรฉe. +MaillonDept lireStdin(void); +ListDept SuppT(ListDept ld);//supprime la tรชte d'une liste +ListDept Supp(ListDept ldp, char *nomdpt);//supprime normal +void deleteIUT(VilleIUT **tV, int nb);//crรฉe un IUT dans la ville souhaitรฉe. +void MaJnameC(VilleIUT **tV, int nb);//mise ร  jour du nom du chef de dรฉpartement +void Save1(VilleIUT **tV, int nb);//sauvegarde le fichier +void SaveEltList(FILE *fs, ListDept l);//sauvegarde un รฉlรฉment de liste +int Admin(VilleIUT **tV, int nb);//partie admin de la premiรจre partie +void AffnbPdpt ( MaillonDept *dpt );//Affiche nombre de place par dรฉpartement d'une liste +void affichenbPIUT (VilleIUT *iut);//Affiche nombre de place restante d'un iut avec ses dรฉpartements +void AffichenbPtableau(VilleIUT ** TIUT, int n);//Affiche le tableau de places restantes des iuts avec leurs dรฉpartements +int utilisateur (VilleIUT **tV, int nb);//Onglet accueille des utilisateurs +void part1(void); // fonction globale + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/*-------------------------------------------------------part2.h------------------------------------------------------*/ + + + +typedef struct { + char ville[20];//ville choisie + char dptmt[20];//dรฉpartement choisi + int dec;//dรฉcision du choix + int valid;//validation du candidat +}Choix; + + +typedef struct Listchx{ + Choix chx; + struct Listchx * suivchx; +}Maillonchx; + +typedef Maillonchx * Listechx; + + +typedef struct { + int nEtu;//numรฉro d'รฉtudiant + char nom[20];//nom de l'รฉtudiant + char prenom[20];//prรฉnom de l'รฉtudiant + float moymat;//moyenne en maths + float moyfr;//moyenne en franรงais + float moyen;//moyenne en anglais + float moyspe;//moyenne en spรฉcialitรฉ + int nbchx;//nombre de choix + Listechx lchx; +}Candidat; + + +typedef struct Mailloncand{ + Candidat cand; + struct Mailloncand * suivcand; +}Mailloncand; + +typedef Mailloncand * Listecand; + + +Listechx initch(void); +Listecand initCand(void); +Choix lirechx (void);//permet de lire un choix selon une entrรฉe stdin +Choix lireC(FILE *fe);//ermet de lire un choix avec un FILe de type fichier.don +Candidat lireCandidat(void);//permet de lire un candidat avec le clavier +Candidat lireCa(FILE *fe);//permet de lire un candidat selon le fichier.don +Listechx InsertTC(Listechx list, Choix m);//insertion en tรชte d'un maillon de type choix +Listechx InsertC(Listechx list, Choix m);//insertion globale d'un maillon de type choix + +void AffC(Candidat c);//affichage simple d'un candidat +void AffCh(Choix c);//affichage simple d'un choix +void affnomcand (Candidat c); +void AffListeCandidat (Listecand l);//affiche complet de la liste de candidats +void AffCandid (Listecand l);//affiche que le nom +void AffListChoix(Listechx l);//affichage complet de la liste de choix +Listecand recherchenom (Listecand l, char *nom );//recherche par un nom dans une liste de candidats +Listecand recherchenum (Listecand l, int num);//recherche par le numรฉro dans une liste de candidats +Listechx searchChx(Listechx lchx, char *ville, char *dptmt); +Listechx recherchechx (Listechx l, char *nom );// recherche par le nom d'un depratement dans une listedederpartement +Listecand recherchevilledpt ( Listecand l, char *ville, char *dpt);//recherche et retour de la liste des candidats ayant postuler a un certain departement +Listechx majchoix (Listechx chx, Choix c);// mise jour d'un choix +Listecand Chargementlistecandidat(FILE *fe, Listecand lC, int *nbC);//chargement du fichier dans une liste de candidats +Listechx suppressionchxT (Listechx l);//Fonction suppression d'un maillon +Listechx suppressionchx(Listechx l , char *depart);//suppression d'un maillon viale nom de son departement +Listecand Insert(Listecand list, Candidat c);//insertion en tรชte d'un maillon de type Candidat +Listecand InsertT(Listecand list, Candidat c);//insertion globale d'un maillon de type Candidat +void test (void);//fonction globale +void testchgt(void); +void saveC(Listecand lC, FILE *fs); +void Save(Listecand lC, int nbC); +void saveChx(Listechx lCh, FILE *fs); + + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/*-------------------------------------------------------part2.h------------------------------------------------------*/ +/*-----------------------------------sans les rรฉpรฉtitions entre les diffรฉrents *.h------------------------------------*/ + + + +typedef struct { + int nEtu;//numรฉro d'รฉtudiant + char nom[26];//nom de l'รฉtudiant + char prenom[26];//prรฉnom de l'รฉtudiant + float moymat;//moyenne en maths + float moyfr;//moyenne en franรงais + float moyen;//moyenne en anglais + float moyspe;//moyenne en spรฉcialitรฉ + float noteDoss;//note aprรจs รฉtude du dossier + int nbchx;//nombre de choix + Listechx lchx; +}Candidat2; + + +typedef struct Mailloncand2{ + Candidat2 cand; + struct Mailloncand2 * suivcand; +}Mailloncand2; + +typedef Mailloncand2 * Listecand2; + + +Choix lireC(FILE *fe);//fonction extraite de la partie 2 +Listechx InsertTC2(Listechx list, Choix m);//Insert en tรชte de la liste +Listechx InsertC2(Listechx list, Choix m);//insert globalement dans liste de choix +Listecand2 InsertT2(Listecand2 list, Candidat2 c);//Insert en tรชte de la liste +Listecand2 Insert2(Listecand2 list, Candidat2 c);//insert globalement +Listecand2 InsertN2(Listecand2 list, Candidat2 c);//insert globalement en fonction de la note +Listecand2 Chargementlistecandidat2(FILE *fe, Listecand2 lC, int *nbC);// fonction de chargement de la liste des candidats +Listecand2 AcceptedOrWait(Listecand2 lC, int *nbC, float noteMin); +void Save2(Listecand2 lC, int nbC);//fonction de sauvegarde globale +void saveC2(Listecand2 lC, FILE *fs);//sauvegarde un candidat +void RespAdmin(void);//fonction dรฉdiรฉe au responsable d'admission +void AffC2(Candidat2 c); +void AffCh2(Choix c); +void AffListeCandidat2(Listecand2 l); +void AffListChoix(Listechx l); +void MajDecJury(Listecand2 lC, int nbC, int nbAcc);//mise ร  jour de la dรฉcision du jury +Listecand2 searchCand(Listecand2 lC, char *nom, char *prenom);//recherche d'un candidat par son nom et prรฉnom +Listecand2 MajNote(Listecand2 lC, char *nom, char *prรฉnom, float newNote);//mise ร  jour de la note de dossier du candidat +Listecand2 splitAccepted(Listecand2 origin);//fonction qui retourne la liste des admis +Listecand2 splitWait(Listecand2 origin);//fonction qui retourne la liste d'attente + + + +void global(void); +void main(void); \ No newline at end of file diff --git a/tsae.c b/tsae.c new file mode 100644 index 0000000..d8618ee --- /dev/null +++ b/tsae.c @@ -0,0 +1,9 @@ +#include +#include +#include +#include"part1.h" + +void main(void) +{ + global(); +} \ No newline at end of file