Developpement/23DEV1.1/TPS1/TP2/20-Fichier/record.c

21 lines
309 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int s;
char b[3];
int i;
FILE* f;
f=fopen("top10","r");
printf("|Hall of Fame|\n");
for(i=0;i<10;i++){
fread(&s,4,1,f);
fread(&b,3,1,f);
printf("%09d %s\n", s, b);
}
fclose(f);
return 0;
}