32 lines
581 B
C
Raw Normal View History

2025-01-07 21:10:07 +01:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
FILE* flux;
size_t lu;
int score,nom;
char a;
char b;
char c;
int i;
flux = fopen("top10", "r");
if (flux==NULL){
printf("erreur d'ouverture \n");
return EXIT_FAILURE;
}
for (i=0;i<10;i++){
lu = fread(&score, sizeof(int),1,flux);
printf("09%d", score,nom);
lu = fread(&a,sizeof(char),1,flux);
lu = fread(&b,sizeof(char),1,flux);
lu = fread(&c,sizeof(char),1,flux);
printf(" %c",a);
printf("%c",b);
printf("%c \n",c);
}fclose(flux);
return EXIT_SUCCESS;
}