master
Lola CHALMIN 2 years ago
parent 649ce7d415
commit 368eeb1b92

@ -37,15 +37,12 @@ Choix lirechx (void){
Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier
{
Candidat c;
int nEtu,nbchx;
float moymat, moyfr, moyen, moyspe;
char nom[20], prenom[20];
printf("Numéro de candidat :\n");
scanf("%d", &c.nEtu);
printf("Nom du candidat :\n");
fgets();
fgets(c.nom, 20, stdin);
printf("Prénom du candidat :\n");
fgets();
fgets(c.prenom, 20, stdin);
printf("Moyenne de maths :\n");
scanf("%f", &c.moymat);
printf("Moyenne de français :\n");
@ -57,6 +54,13 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier
printf("Nombre de choix :\n");
scanf("%d", &c.nbchx);
scanf("%d", nbchx);
kdjfbnjn
return c;
}
void AffC(Candidat c)
{
printf("%d\n", c.nEtu);
printf("%s \n %s\n", c.nom, c.prenom);
printf("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe);
printf("%d\n", c.nbchx);
}

@ -2,3 +2,11 @@
#include <stdlib.h>
#include <string.h>
#include "commun.h"
int main(void)
{
Candidat c;
c = lireCandidat();
return 0;
}
Loading…
Cancel
Save