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.

67 lines
2.5 KiB

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "iut.h"
void MenuRespon(Candidat *tcandidat[],VilleIUT *tiut[], int n, int nc){
int Achoix, choix, i, j, m, comp, comp1;
char Ncandidat[30], PNcandidat[30], departement[30],Ville[30];
printf("\nVille où se situe le departement \n:");
scanf("%s",Ville);
printf("\nVotre Departement\n:");
scanf("%s", departement);
for(i=0;i<nc;i++){
comp=strcmp(tiut[i]->ville, Ville);
if(comp==0){
for(j=0;j<=tiut[i]->nbDep;j++){
if(strcmp(tiut[i]->ldept->departement, departement) == 0 && tiut[i]->ldept->AouD == 'D'){
for(m=0;m<nc;m++){
if(rechercheCandidatParVille(tcandidat[m]->lchoix,departement,Ville, nc) ==0){
afficheCandidat(tcandidat, m);
}
}
}
tiut[i]->ldept=tiut[i]->ldept->suivant;
}
}
}
/*
while(Achoix>0 && Achoix<3){
if(Achoix==1){
// a toi nicolas
}
if(Achoix==2){
printf("\n0-Revenir au menu\n1-Afficher Info pour un Candidat\n2-Afficher tout les Candidat par departement\n3-Afficher tout les Candidat avec leur information\n:");
scanf("\n%d",&choix);
while(choix>0 ){
if(choix==1){
printf("\nnom du candidat:");
scanf("%s",Ncandidat);
printf("\nprenom du candidat:");
scanf("%s",PNcandidat);
for(i=0;i<nc;i++){
comp=strcmp(tcandidat[i]->nom, Ncandidat);
comp1=strcmp(tcandidat[i]->prenom, PNcandidat);
if(comp==0 && comp1==0){
afficheCandidat(tcandidat, i);
affichageListeCandidatchoix(tcandidat[i]->lchoix);
}
}
}
if(choix==2){
printf("\nnom du departement souhaiter :");
scanf("%s",departement);
}
if(choix==3){
printf("\n\n\n\t\tTableau Candidat et choix\n");
affichageCandidatchoix(tcandidat,nc);
}
printf("\nVoulez-vous choisir une autre fonction ? Sinon taper 0 pour valider : ");
scanf("%d%*c",&choix);
}
}
}*/
}