2020-12-13 14:41:38 +01:00
|
|
|
|
#include <stdio.h>
|
2020-12-14 16:26:50 +01:00
|
|
|
|
#include <stdlib.h>
|
2020-12-13 14:41:38 +01:00
|
|
|
|
|
2020-12-15 19:11:03 +01:00
|
|
|
|
#define FILETEST "test"
|
|
|
|
|
#define FILEINPUT "input"
|
|
|
|
|
|
2020-12-14 01:18:07 +01:00
|
|
|
|
void prem_partie(FILE *ptr);
|
|
|
|
|
void deux_partie(FILE *ptr);
|
2020-12-13 14:41:38 +01:00
|
|
|
|
|
2020-12-14 16:26:50 +01:00
|
|
|
|
int main(int argc, char *argv[])
|
2020-12-13 14:41:38 +01:00
|
|
|
|
{
|
2020-12-15 19:11:03 +01:00
|
|
|
|
char *filename = argc > 1 ? FILETEST : FILEINPUT;
|
2020-12-14 16:26:50 +01:00
|
|
|
|
|
|
|
|
|
FILE *ptr = fopen(filename, "r");
|
2020-12-13 14:41:38 +01:00
|
|
|
|
if (ptr == NULL)
|
|
|
|
|
{
|
2020-12-14 16:26:50 +01:00
|
|
|
|
printf("Le fichier %s n’existe pas.\n", filename);
|
2020-12-13 14:41:38 +01:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("Traitement de la première partie…\n");
|
2020-12-14 01:18:07 +01:00
|
|
|
|
prem_partie(ptr);
|
2020-12-13 14:41:38 +01:00
|
|
|
|
fseek(ptr, 0, SEEK_SET);
|
|
|
|
|
printf("\nTraitement de la deuxième partie…\n");
|
2020-12-14 01:18:07 +01:00
|
|
|
|
deux_partie(ptr);
|
2020-12-13 14:41:38 +01:00
|
|
|
|
|
|
|
|
|
fclose(ptr);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|