DEV/DEV1.1/TP13:Fichiers/records.c

22 lines
324 B
C
Raw Permalink Normal View History

2022-11-23 16:46:05 +01:00
#include <stdio.h>
#include <stdlib.h>
int main(void) {
FILE *f;
int i;
int j;
int score;
char nom[4];
f=fopen("top10","r");
for (i=0;i<10;i++){
fread(&score,4,1,f);
printf("%09d",score);
fread(nom,1,3,f);
printf(" ");
for (j=0;j<4;j++){
printf("%c",nom[j]);
} printf("\n");
}
fclose(f);
return 0;
}