Ajout de la fonction d'affichage des places

master
Kyllian CHABANON 2 years ago
parent da798d1753
commit 937ea2c2f3

@ -19,6 +19,7 @@ void afficherDept(ListeDept l);
int rechercheDept(ListeDept l, char departement[], bool *trouve);
ListeDept supprimerEnTete(ListeDept l);
ListeDept supprimer(ListeDept l, char departement[]);
int longueur(ListeDept l);
int getNbP(ListeDept l, int pos);
void setNbP(ListeDept l, int pos, int valeur);

BIN
exe

Binary file not shown.

@ -164,3 +164,12 @@ char* getDept(ListeDept l, int pos)
}
return l->departement;
}
int longueur(ListeDept l)
{
if (vide(l))
{
return 0;
}
return 1 + longueur(l->suiv);
}

@ -18,3 +18,16 @@ void affichageDeptIUT(VilleIUT *tiut[], int nb)
afficherDept(tiut[i]->ldept);
}
}
void affichageNbP(VilleIUT *tiut[], int nb)
{
printf("Voici le nombre de places dans chaque département de chaque IUT :");
for (int i = 0; i < nb; i++)
{
printf("\t%s :\n", tiut[i]->ville);
for (int v = 0; v < longueur(tiut[i]->ldept); v++)
{
printf("\t%s :\t%s", getDept(tiut[i]->ldept, v), getNbP(tiut[i]->ldept, v));
}
}
}
Loading…
Cancel
Save