32 lines
581 B
C
32 lines
581 B
C
#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;
|
|
}
|
|
|
|
|
|
|