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