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-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-14 16:26:50 +01:00
|
|
|
|
char *filename;
|
|
|
|
|
if (argc > 1)
|
|
|
|
|
{
|
|
|
|
|
char test[6] = "test";
|
|
|
|
|
filename = test;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
char input[6] = "input";
|
|
|
|
|
filename = input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|