From b2968133b1d1283bd1b80dd02030dd6dfcfed1fa Mon Sep 17 00:00:00 2001 From: tvolleri Date: Fri, 3 May 2019 18:23:49 +0200 Subject: [PATCH] inutile --- projet.c | 72 ------------------------------------------------------------------------ 1 file changed, 0 insertions(+), 72 deletions(-) delete mode 100644 projet.c diff --git a/projet.c b/projet.c deleted file mode 100644 index f170227..0000000 --- a/projet.c +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include - - -typedef struct cell* ptarbre; -typedef struct cell* ptcellule; - -typedef struct cell { - int lettre; - ptarbre arbre; - ptcellule suivant; -} cell; - -/* Pas utile -void init_dico() -{ - ptarbre arbre; - arbre=NULL; -} -*/ -ptarbre rech(ptarbre arbre, int lettre) -{ - while((arbre!=NULL) && (arbre->lettre != lettre)) - arbre=arbre->suivant; - return arbre; -} -void ajout_dico(ptarbre arbre, int lettre) -{ - arbre=malloc(sizeof(cell)); - arbre->lettre=lettre; - arbre->arbre=NULL; - arbre->suivant=NULL; -} - -void affiche_dico(ptarbre arbre) -{ - - printf("%c\n", arbre->lettre); -} - - -int main() -{ - ptarbre arbre; - arbre=NULL; - char c; - // Ouvrir fichier - FILE *fp = fopen("words","r"); - if (fp==NULL) - printf("words inaccessible ",fp); - else - printf("words accessible n",fp); - - while (fscanf(fp,"%d",&c)!= EOF) // lecture de tout le fichier - { - while (c!='\n') - { - if (rech(arbre,c)==NULL) - { - ajout_dico(arbre,c); - } - arbre=arbre->arbre; // On va à l'étage d'après pour former le mot dans l'arbre - affiche_dico(arbre); - } - } - - - - - - return 0; -} -- libgit2 0.21.2