Blame view

SD/TP6_Hachage/main.c 390 Bytes
cb716d77   Vincent Benoist   SD jusqua hachage
1
2
3
4
5
6
7
8
9
10
11
  /* main.c */
  #include <stdio.h>
  #include "hachage_simple.h"
  
  int hachage_basique (double d)
  {
      return (int)d % N;
  }
  
  int main ()
  {   
cb716d77   Vincent Benoist   SD jusqua hachage
12
13
14
      struct table T;
      double x;
      init_table (&T, &hachage_basique);
5be5d85e   Vincent Benoist   tp processus
15
16
  
      scanf ("%lf", &x);
cb716d77   Vincent Benoist   SD jusqua hachage
17
18
      while (x != -1){
          enregistrer_table (&T, x);
5be5d85e   Vincent Benoist   tp processus
19
20
          imprimer_table (&T);
          scanf ("%lf", &x);
cb716d77   Vincent Benoist   SD jusqua hachage
21
      }
5be5d85e   Vincent Benoist   tp processus
22
      clear_table (&T);
cb716d77   Vincent Benoist   SD jusqua hachage
23
24
      return 0;
  }