1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| struct equipe
{
int numero;
int nb_match_gagnes;
int nb_match_perdus;
};
void initialiser_championnat(equipe tableau_equipe[8])
{
for(int i = 0; i < 8; ++i)
{
tableau_equipe[i].numero = i + 1;
tableau_equipe[i].nb_match_gagnes = 0;
tableau_equipe[i].nb_match_perdus = 0;
}
}
void afficher_championnat(equipe tableau_equipe[8])
{
for(int i = 0; i < 8; ++i)
{
printf("Equipe %d : %d points, %d match(s) perdu(s)\n"; i + 1, tableau_equipe[i].nb_match_gagnes*2 + tableau_equipe[i].nb_match_perdus, tableau_equipe[i].nb_match_gagnes; tableau_equipe[i].nb_match_perdus);
}
} |
Partager