From 6356642a7fc578ebc67acb3647f23b097abc5d07 Mon Sep 17 00:00:00 2001 From: Nolan DEVOUASSOUX Date: Fri, 28 Oct 2022 09:05:03 +0200 Subject: [PATCH] j'ai mis les dossiers que j'avais commancer avant codefirst --- adherent.txt | 2 ++ sae.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sae.h | 35 +++++++++++++++++++++ saetest.c | 8 +++++ 4 files changed, 133 insertions(+) create mode 100644 adherent.txt create mode 100644 sae.c create mode 100644 sae.h create mode 100644 saetest.c diff --git a/adherent.txt b/adherent.txt new file mode 100644 index 0000000..f255129 --- /dev/null +++ b/adherent.txt @@ -0,0 +1,2 @@ +100 P J 52 1 42 +101 D F 18 0 51 diff --git a/sae.c b/sae.c new file mode 100644 index 0000000..306159d --- /dev/null +++ b/sae.c @@ -0,0 +1,88 @@ +#include +#include +#include "sae.h" + +int creeadherent(int *tNC,char *tN,char *tPR,int *tA,int *tCA,int *tPO, int Tmax) +{ + int NC,N,PR,A,CA,PO, i=0; + FILE *fe; + fe=fopen("adherent.txt","r"); + if(fe == NULL) + { + printf("pbouvrfichier\n"); + return -1; + } + + fscanf(fe,"%d %s %s %d %d %d",&NC,&N,&PR,&A,&CA,&PO); + while (!feof(fe)) + { + if(i==Tmax) + { + printf("%d \t %d\n",i, Tmax); + printf("capasité atteinte\n"); + fclose(fe); + return -1; + } + tNC[i]=NC; + tN[i]=N; + tPR[i]=PR; + tA[i]=A; + tCA[i]=CA; + tPO[i]=PO; + i++; + fscanf(fe,"%d %s %s %d %d %d",&NC,&N,&PR,&A,&CA,&PO); + } + fclose(fe); + return i; +} + + + + +void affichageA(int *tNC,char *tN,char *tPR,int *tA,int *tCA,int *tPO, int n) +{ + int i; + printf("----------------------------------------------------------------------------\n"); + printf("n°client nom\t prenom\t age\t carte\t point\n"); + for (i=0;i + +int main(void) +{ + globale(); + return 0; +} \ No newline at end of file