APL/APL1.2/Dev1.2/Fichiers/Challenger.c

24 lines
674 B
C
Raw Normal View History

2021-11-30 15:07:19 +01:00
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
int a,score;
int tab[10];
char nom [3];
FILE* flux;
FILE* flux2;
flux = fopen("/export/home/an21/vieirae/APL/APL1.2/Dev1.2/Fichiers/top10", "r");
flux2 = fopen("/export/home/an21/vieirae/APL/APL1.2/Dev1.2/Fichiers/top10", "w");
if (flux == NULL) {
printf("accès au fichier impossible !");
return EXIT_FAILURE;
}
fwrite (("%09d %c",argc[2],argv),4, 1,flux2);
for (int i = 0;i<11;i++){
fread (&a,4,1,flux2);
fread (&tab, 1, 3,flux2);
printf ("%09d %s\n",a,tab);
}
fclose(flux);
return EXIT_SUCCESS;
}