Commit 0c252f1e7fa343e5c15b951a67b9574180d9ef2f
1 parent
731e6094
commit du 2 avril
Showing
1 changed file
with
685 additions
and
498 deletions
Show diff stats
projet.c
1 | -#include <stdio.h> | |
2 | -#include <stdlib.h> | |
3 | -#include <string.h> | |
4 | - | |
5 | -typedef struct noeud | |
6 | -{ | |
7 | - int valeur; | |
8 | - struct noeud *a; | |
9 | - struct noeud *b; | |
10 | - struct noeud *c; | |
11 | - struct noeud *d; | |
12 | - struct noeud *e; | |
13 | - struct noeud *f; | |
14 | - struct noeud *g; | |
15 | - struct noeud *h; | |
16 | - struct noeud *i; | |
17 | - struct noeud *j; | |
18 | - struct noeud *k; | |
19 | - struct noeud *l; | |
20 | - struct noeud *m; | |
21 | - struct noeud *n; | |
22 | - struct noeud *o; | |
23 | - struct noeud *p; | |
24 | - struct noeud *q; | |
25 | - struct noeud *r; | |
26 | - struct noeud *s; | |
27 | - struct noeud *t; | |
28 | - struct noeud *u; | |
29 | - struct noeud *v; | |
30 | - struct noeud *w; | |
31 | - struct noeud *x; | |
32 | - struct noeud *y; | |
33 | - struct noeud *z; | |
34 | -} noeud ; | |
35 | - | |
36 | - | |
37 | - | |
38 | - | |
39 | -void insertion1(noeud ** arbre, int v){ | |
40 | - | |
41 | - *arbre=(noeud*) malloc(sizeof(noeud)); | |
42 | - (*arbre)->valeur=v; | |
43 | - (*arbre)->a=NULL; | |
44 | - (*arbre)->b=NULL; | |
45 | - (*arbre)->c=NULL; | |
46 | - (*arbre)->d=NULL; | |
47 | - (*arbre)->e=NULL; | |
48 | - (*arbre)->f=NULL; | |
49 | - (*arbre)->g=NULL; | |
50 | - (*arbre)->h=NULL; | |
51 | - (*arbre)->i=NULL; | |
52 | - (*arbre)->j=NULL; | |
53 | - (*arbre)->k=NULL; | |
54 | - (*arbre)->l=NULL; | |
55 | - (*arbre)->m=NULL; | |
56 | - (*arbre)->n=NULL; | |
57 | - (*arbre)->o=NULL; | |
58 | - (*arbre)->p=NULL; | |
59 | - (*arbre)->q=NULL; | |
60 | - (*arbre)->r=NULL; | |
61 | - (*arbre)->s=NULL; | |
62 | - (*arbre)->t=NULL; | |
63 | - (*arbre)->u=NULL; | |
64 | - (*arbre)->v=NULL; | |
65 | - (*arbre)->w=NULL; | |
66 | - (*arbre)->x=NULL; | |
67 | - (*arbre)->y=NULL; | |
68 | - (*arbre)->z=NULL; | |
69 | - | |
70 | -} | |
71 | - | |
72 | -void insertion2(noeud ** arbre, int v){ | |
73 | - | |
74 | - { | |
75 | - | |
76 | - if (v==97) | |
77 | - insertion1(&(*arbre)->a,v); | |
78 | - | |
79 | - else if (v==98) | |
80 | - insertion1(&(*arbre)->b,v); | |
81 | - else if (v==99) | |
82 | - insertion1(&(*arbre)->c,v); | |
83 | - else if (v==99) | |
84 | - insertion1(&(*arbre)->c,v); | |
85 | - else if (v==100) | |
86 | - insertion1(&(*arbre)->d,v); | |
87 | - else if (v==101) | |
88 | - insertion1(&(*arbre)->e,v); | |
89 | - else if (v==102) | |
90 | - insertion1(&(*arbre)->f,v); | |
91 | - else if (v==103) | |
92 | - insertion1(&(*arbre)->g,v); | |
93 | - else if (v==104) | |
94 | - insertion1(&(*arbre)->h,v); | |
95 | - else if (v==105) | |
96 | - insertion1(&(*arbre)->i,v); | |
97 | - else if (v==106) | |
98 | - insertion1(&(*arbre)->j,v); | |
99 | - else if (v==107) | |
100 | - insertion1(&(*arbre)->k,v); | |
101 | - else if (v==108) | |
102 | - insertion1(&(*arbre)->l,v); | |
103 | - else if (v==109) | |
104 | - insertion1(&(*arbre)->m,v); | |
105 | - else if (v==110) | |
106 | - insertion1(&(*arbre)->n,v); | |
107 | - else if (v==111) | |
108 | - insertion1(&(*arbre)->o,v); | |
109 | - else if (v==112) | |
110 | - insertion1(&(*arbre)->p,v); | |
111 | - else if (v==113) | |
112 | - insertion1(&(*arbre)->q,v); | |
113 | - else if (v==114) | |
114 | - insertion1(&(*arbre)->r,v); | |
115 | - else if (v==115) | |
116 | - insertion1(&(*arbre)->s,v); | |
117 | - else if (v==116) | |
118 | - insertion1(&(*arbre)->t,v); | |
119 | - else if (v==117) | |
120 | - insertion1(&(*arbre)->u,v); | |
121 | - else if (v==118) | |
122 | - insertion1(&(*arbre)->v,v); | |
123 | - else if (v==119) | |
124 | - insertion1(&(*arbre)->w,v); | |
125 | - else if (v==120) | |
126 | - insertion1(&(*arbre)->x,v); | |
127 | - else if (v==121) | |
128 | - insertion1(&(*arbre)->y,v); | |
129 | - else if (v==122) | |
130 | - insertion1(&(*arbre)->z,v); | |
131 | - | |
132 | - | |
133 | - } | |
134 | -} | |
135 | - | |
136 | -void remplissage(noeud ** arbre, FILE *fichier){ | |
137 | - int i; | |
138 | - char ch[20]; | |
139 | - fscanf(fichier,"%s",&ch); | |
140 | - int n=strlen(ch); | |
141 | - insertion1(&(*arbre),(int)ch[0]); | |
142 | - for (i=1;i<n;i++) | |
143 | - insertion2(&(*arbre),(int)ch[i]); | |
144 | -} | |
145 | - | |
146 | -void lecture(noeud ** arbre, FILE *fichier){ | |
147 | - int i; | |
148 | - for(i=0;i<10;i++) | |
149 | - remplissage(&(*arbre),fichier); | |
150 | -} | |
151 | - | |
152 | -void textes(FILE *fichier){ | |
153 | - char ch[20]; | |
154 | - int i; | |
155 | - if (fichier != NULL){ | |
156 | - FILE *fichierA=fopen("A.txt","w"); | |
157 | - FILE *fichierB=fopen("B.txt","w"); | |
158 | - FILE *fichierC=fopen("C.txt","w"); | |
159 | - FILE *fichierD=fopen("D.txt","w"); | |
160 | - FILE *fichierE=fopen("E.txt","w"); | |
161 | - FILE *fichierF=fopen("F.txt","w"); | |
162 | - FILE *fichierG=fopen("G.txt","w"); | |
163 | - FILE *fichierH=fopen("H.txt","w"); | |
164 | - FILE *fichierI=fopen("I.txt","w"); | |
165 | - FILE *fichierJ=fopen("J.txt","w"); | |
166 | - FILE *fichierK=fopen("K.txt","w"); | |
167 | - FILE *fichierL=fopen("L.txt","w"); | |
168 | - FILE *fichierM=fopen("M.txt","w"); | |
169 | - FILE *fichierN=fopen("N.txt","w"); | |
170 | - FILE *fichierO=fopen("O.txt","w"); | |
171 | - FILE *fichierP=fopen("P.txt","w"); | |
172 | - FILE *fichierQ=fopen("Q.txt","w"); | |
173 | - FILE *fichierR=fopen("R.txt","w"); | |
174 | - FILE *fichierS=fopen("S.txt","w"); | |
175 | - FILE *fichierT=fopen("T.txt","w"); | |
176 | - FILE *fichierU=fopen("U.txt","w"); | |
177 | - FILE *fichierV=fopen("V.txt","w"); | |
178 | - FILE *fichierW=fopen("W.txt","w"); | |
179 | - FILE *fichierX=fopen("X.txt","w"); | |
180 | - FILE *fichierY=fopen("Y.txt","w"); | |
181 | - FILE *fichierZ=fopen("Z.txt","w"); | |
182 | - do{ | |
183 | - int n=strlen(ch); | |
184 | - | |
185 | - if((int)ch[0]==97){ | |
186 | - for(i=0;i<n;i++) | |
187 | - fprintf(fichierA,"%c",ch[i]); | |
188 | - fprintf(fichierA,"%s","\n"); | |
189 | - } | |
190 | - | |
191 | - if((int)ch[0]==98){ | |
192 | - for(i=0;i<n;i++) | |
193 | - fprintf(fichierB,"%c",ch[i]); | |
194 | - fprintf(fichierB,"%s","\n"); | |
195 | - } | |
196 | - | |
197 | - if((int)ch[0]==99){ | |
198 | - for(i=0;i<n;i++) | |
199 | - fprintf(fichierC,"%c",ch[i]); | |
200 | - fprintf(fichierC,"%s","\n"); | |
201 | - } | |
202 | - | |
203 | - if((int)ch[0]==100){ | |
204 | - for(i=0;i<n;i++) | |
205 | - fprintf(fichierD,"%c",ch[i]); | |
206 | - fprintf(fichierD,"%s","\n"); | |
207 | - } | |
208 | - | |
209 | - if((int)ch[0]==101){ | |
210 | - for(i=0;i<n;i++) | |
211 | - fprintf(fichierE,"%c",ch[i]); | |
212 | - fprintf(fichierE,"%s","\n"); | |
213 | - } | |
214 | - | |
215 | - if((int)ch[0]==102){ | |
216 | - for(i=0;i<n;i++) | |
217 | - fprintf(fichierF,"%c",ch[i]); | |
218 | - fprintf(fichierF,"%s","\n"); | |
219 | - } | |
220 | - | |
221 | - if((int)ch[0]==103){ | |
222 | - for(i=0;i<n;i++) | |
223 | - fprintf(fichierG,"%c",ch[i]); | |
224 | - fprintf(fichierG,"%s","\n"); | |
225 | - } | |
226 | - | |
227 | - if((int)ch[0]==104){ | |
228 | - for(i=0;i<n;i++) | |
229 | - fprintf(fichierH,"%c",ch[i]); | |
230 | - fprintf(fichierH,"%s","\n"); | |
231 | - } | |
232 | - | |
233 | - if((int)ch[0]==105){ | |
234 | - for(i=0;i<n;i++) | |
235 | - fprintf(fichierI,"%c",ch[i]); | |
236 | - fprintf(fichierI,"%s","\n"); | |
237 | - } | |
238 | - | |
239 | - if((int)ch[0]==106){ | |
240 | - for(i=0;i<n;i++) | |
241 | - fprintf(fichierJ,"%c",ch[i]); | |
242 | - fprintf(fichierJ,"%s","\n"); | |
243 | - } | |
244 | - | |
245 | - if((int)ch[0]==107){ | |
246 | - for(i=0;i<n;i++) | |
247 | - fprintf(fichierK,"%c",ch[i]); | |
248 | - fprintf(fichierK,"%s","\n"); | |
249 | - } | |
250 | - | |
251 | - if((int)ch[0]==108){ | |
252 | - for(i=0;i<n;i++) | |
253 | - fprintf(fichierL,"%c",ch[i]); | |
254 | - fprintf(fichierL,"%s","\n"); | |
255 | - } | |
256 | - | |
257 | - if((int)ch[0]==109){ | |
258 | - for(i=0;i<n;i++) | |
259 | - fprintf(fichierM,"%c",ch[i]); | |
260 | - fprintf(fichierM,"%s","\n"); | |
261 | - } | |
262 | - | |
263 | - if((int)ch[0]==110){ | |
264 | - for(i=0;i<n;i++) | |
265 | - fprintf(fichierN,"%c",ch[i]); | |
266 | - fprintf(fichierN,"%s","\n"); | |
267 | - } | |
268 | - | |
269 | - if((int)ch[0]==111){ | |
270 | - for(i=0;i<n;i++) | |
271 | - fprintf(fichierO,"%c",ch[i]); | |
272 | - fprintf(fichierO,"%s","\n"); | |
273 | - } | |
274 | - | |
275 | - if((int)ch[0]==112){ | |
276 | - for(i=0;i<n;i++) | |
277 | - fprintf(fichierP,"%c",ch[i]); | |
278 | - fprintf(fichierP,"%s","\n"); | |
279 | - } | |
280 | - | |
281 | - if((int)ch[0]==113){ | |
282 | - for(i=0;i<n;i++) | |
283 | - fprintf(fichierQ,"%c",ch[i]); | |
284 | - fprintf(fichierQ,"%s","\n"); | |
285 | - } | |
286 | - | |
287 | - if((int)ch[0]==114){ | |
288 | - for(i=0;i<n;i++) | |
289 | - fprintf(fichierR,"%c",ch[i]); | |
290 | - fprintf(fichierR,"%s","\n"); | |
291 | - } | |
292 | - | |
293 | - if((int)ch[0]==115){ | |
294 | - for(i=0;i<n;i++) | |
295 | - fprintf(fichierS,"%c",ch[i]); | |
296 | - fprintf(fichierS,"%s","\n"); | |
297 | - } | |
298 | - | |
299 | - if((int)ch[0]==116){ | |
300 | - for(i=0;i<n;i++) | |
301 | - fprintf(fichierT,"%c",ch[i]); | |
302 | - fprintf(fichierT,"%s","\n"); | |
303 | - } | |
304 | - | |
305 | - if((int)ch[0]==117){ | |
306 | - for(i=0;i<n;i++) | |
307 | - fprintf(fichierU,"%c",ch[i]); | |
308 | - fprintf(fichierU,"%s","\n"); | |
309 | - } | |
310 | - | |
311 | - if((int)ch[0]==118){ | |
312 | - for(i=0;i<n;i++) | |
313 | - fprintf(fichierV,"%c",ch[i]); | |
314 | - fprintf(fichierV,"%s","\n"); | |
315 | - } | |
316 | - | |
317 | - if((int)ch[0]==119){ | |
318 | - for(i=0;i<n;i++) | |
319 | - fprintf(fichierW,"%c",ch[i]); | |
320 | - fprintf(fichierW,"%s","\n"); | |
321 | - } | |
322 | - | |
323 | - if((int)ch[0]==120){ | |
324 | - for(i=0;i<n;i++) | |
325 | - fprintf(fichierX,"%c",ch[i]); | |
326 | - fprintf(fichierX,"%s","\n"); | |
327 | - } | |
328 | - | |
329 | - if((int)ch[0]==121){ | |
330 | - for(i=0;i<n;i++) | |
331 | - fprintf(fichierY,"%c",ch[i]); | |
332 | - fprintf(fichierY,"%s","\n"); | |
333 | - } | |
334 | - | |
335 | - if((int)ch[0]==122){ | |
336 | - for(i=0;i<n;i++) | |
337 | - fprintf(fichierZ,"%c",ch[i]); | |
338 | - fprintf(fichierZ,"%s","\n"); | |
339 | - } | |
340 | - | |
341 | - } while(fscanf(fichier,"%s",&ch)==1); | |
342 | - | |
343 | - fclose(fichierA); | |
344 | - fclose(fichierB); | |
345 | - fclose(fichierC); | |
346 | - fclose(fichierD); | |
347 | - fclose(fichierE); | |
348 | - fclose(fichierF); | |
349 | - fclose(fichierG); | |
350 | - fclose(fichierH); | |
351 | - fclose(fichierI); | |
352 | - fclose(fichierJ); | |
353 | - fclose(fichierK); | |
354 | - fclose(fichierL); | |
355 | - fclose(fichierM); | |
356 | - fclose(fichierN); | |
357 | - fclose(fichierO); | |
358 | - fclose(fichierP); | |
359 | - fclose(fichierQ); | |
360 | - fclose(fichierR); | |
361 | - fclose(fichierS); | |
362 | - fclose(fichierT); | |
363 | - fclose(fichierU); | |
364 | - fclose(fichierV); | |
365 | - fclose(fichierW); | |
366 | - fclose(fichierX); | |
367 | - fclose(fichierY); | |
368 | - fclose(fichierZ); | |
369 | - | |
370 | - | |
371 | - } | |
372 | - fclose(fichier); | |
373 | -} | |
374 | - | |
375 | - | |
376 | - | |
377 | - | |
378 | -int main(){ | |
379 | - | |
380 | - | |
381 | - | |
382 | - noeud *ArbreA = NULL; | |
383 | - noeud *ArbreB = NULL; | |
384 | - noeud *ArbreC = NULL; | |
385 | - noeud *ArbreD = NULL; | |
386 | - noeud *ArbreE = NULL; | |
387 | - noeud *ArbreF = NULL; | |
388 | - noeud *ArbreG = NULL; | |
389 | - noeud *ArbreH = NULL; | |
390 | - noeud *ArbreI = NULL; | |
391 | - noeud *ArbreJ = NULL; | |
392 | - noeud *ArbreK = NULL; | |
393 | - noeud *ArbreL = NULL; | |
394 | - noeud *ArbreM = NULL; | |
395 | - noeud *ArbreN = NULL; | |
396 | - noeud *ArbreO = NULL; | |
397 | - noeud *ArbreP = NULL; | |
398 | - noeud *ArbreQ = NULL; | |
399 | - noeud *ArbreR = NULL; | |
400 | - noeud *ArbreS = NULL; | |
401 | - noeud *ArbreT = NULL; | |
402 | - noeud *ArbreU = NULL; | |
403 | - noeud *ArbreV = NULL; | |
404 | - noeud *ArbreW = NULL; | |
405 | - noeud *ArbreX = NULL; | |
406 | - noeud *ArbreY = NULL; | |
407 | - noeud *ArbreZ = NULL; | |
408 | - | |
409 | - FILE *fichier=fopen("dico.txt","r"); | |
410 | - FILE *fichierA=fopen("A.txt","r"); | |
411 | - FILE *fichierB=fopen("B.txt","r"); | |
412 | - FILE *fichierC=fopen("C.txt","r"); | |
413 | - FILE *fichierD=fopen("D.txt","r"); | |
414 | - FILE *fichierE=fopen("E.txt","r"); | |
415 | - FILE *fichierF=fopen("F.txt","r"); | |
416 | - FILE *fichierG=fopen("G.txt","r"); | |
417 | - FILE *fichierH=fopen("H.txt","r"); | |
418 | - FILE *fichierI=fopen("I.txt","r"); | |
419 | - FILE *fichierJ=fopen("J.txt","r"); | |
420 | - FILE *fichierK=fopen("K.txt","r"); | |
421 | - FILE *fichierL=fopen("L.txt","r"); | |
422 | - FILE *fichierM=fopen("M.txt","r"); | |
423 | - FILE *fichierN=fopen("N.txt","r"); | |
424 | - FILE *fichierO=fopen("O.txt","r"); | |
425 | - FILE *fichierP=fopen("P.txt","r"); | |
426 | - FILE *fichierQ=fopen("Q.txt","r"); | |
427 | - FILE *fichierR=fopen("R.txt","r"); | |
428 | - FILE *fichierS=fopen("S.txt","r"); | |
429 | - FILE *fichierT=fopen("T.txt","r"); | |
430 | - FILE *fichierU=fopen("U.txt","r"); | |
431 | - FILE *fichierV=fopen("V.txt","r"); | |
432 | - FILE *fichierW=fopen("W.txt","r"); | |
433 | - FILE *fichierX=fopen("X.txt","r"); | |
434 | - FILE *fichierY=fopen("Y.txt","r"); | |
435 | - FILE *fichierZ=fopen("Z.txt","r"); | |
436 | - | |
437 | - | |
438 | - textes(fichier); | |
439 | - | |
440 | - lecture(&ArbreA,fichierA); | |
441 | - lecture(&ArbreB,fichierB); | |
442 | - lecture(&ArbreC,fichierC); | |
443 | - lecture(&ArbreD,fichierD); | |
444 | - lecture(&ArbreE,fichierE); | |
445 | - lecture(&ArbreF,fichierF); | |
446 | - lecture(&ArbreG,fichierG); | |
447 | - lecture(&ArbreH,fichierH); | |
448 | - lecture(&ArbreI,fichierI); | |
449 | - lecture(&ArbreJ,fichierJ); | |
450 | - lecture(&ArbreK,fichierK); | |
451 | - lecture(&ArbreL,fichierL); | |
452 | - lecture(&ArbreM,fichierM); | |
453 | - lecture(&ArbreN,fichierN); | |
454 | - lecture(&ArbreO,fichierO); | |
455 | - lecture(&ArbreP,fichierP); | |
456 | - lecture(&ArbreQ,fichierQ); | |
457 | - lecture(&ArbreR,fichierR); | |
458 | - lecture(&ArbreS,fichierS); | |
459 | - lecture(&ArbreT,fichierT); | |
460 | - lecture(&ArbreU,fichierU); | |
461 | - lecture(&ArbreV,fichierV); | |
462 | - lecture(&ArbreW,fichierW); | |
463 | - lecture(&ArbreX,fichierX); | |
464 | - lecture(&ArbreY,fichierY); | |
465 | - lecture(&ArbreZ,fichierZ); | |
466 | - | |
467 | - | |
468 | - fclose(fichier); | |
469 | - fclose(fichierA); | |
470 | - fclose(fichierB); | |
471 | - fclose(fichierC); | |
472 | - fclose(fichierD); | |
473 | - fclose(fichierE); | |
474 | - fclose(fichierF); | |
475 | - fclose(fichierG); | |
476 | - fclose(fichierH); | |
477 | - fclose(fichierI); | |
478 | - fclose(fichierJ); | |
479 | - fclose(fichierK); | |
480 | - fclose(fichierL); | |
481 | - fclose(fichierM); | |
482 | - fclose(fichierN); | |
483 | - fclose(fichierO); | |
484 | - fclose(fichierP); | |
485 | - fclose(fichierQ); | |
486 | - fclose(fichierR); | |
487 | - fclose(fichierS); | |
488 | - fclose(fichierT); | |
489 | - fclose(fichierU); | |
490 | - fclose(fichierV); | |
491 | - fclose(fichierW); | |
492 | - fclose(fichierX); | |
493 | - fclose(fichierY); | |
494 | - fclose(fichierZ); | |
495 | - | |
496 | - | |
497 | - return 0; | |
498 | -} | |
1 | +#include <stdio.h> | |
2 | +#include <stdlib.h> | |
3 | +#include <string.h> | |
4 | +#include <stdbool.h> | |
5 | + | |
6 | + | |
7 | +typedef struct noeud{ | |
8 | + int valeur; | |
9 | + struct noeud *lettre[26]; | |
10 | +} noeud ; | |
11 | + | |
12 | +noeud *getTreeBranch(noeud * arbre,int i){ | |
13 | + return arbre->lettre[i]; | |
14 | +} | |
15 | + | |
16 | +void create_and_initialize_node(noeud ** parbre, int v){ | |
17 | + | |
18 | + *parbre=malloc(sizeof(noeud)); | |
19 | + (*parbre)->valeur=v; | |
20 | + int i; | |
21 | + for(i=0;i<26;i++) | |
22 | + (*parbre)->lettre[i]=NULL; | |
23 | + | |
24 | +} | |
25 | + | |
26 | +void remplissage(noeud ** parbre, FILE *fichier){ | |
27 | + int i; | |
28 | + char ch[128]; | |
29 | + fscanf(fichier,"%s",&ch); | |
30 | + int n=strlen(ch); | |
31 | + create_and_initialize_node(parbre,ch[0]); | |
32 | + for(i=1;i<n;i++){ | |
33 | + noeud *parbre_suiv=getTreeBranch(*parbre,ch[i]-'a'); | |
34 | + create_and_initialize_node(&parbre_suiv,ch[i]); | |
35 | + | |
36 | + } | |
37 | +} | |
38 | +void lecture(noeud ** arbre, FILE *fichier){ | |
39 | + int i; | |
40 | + for(i=0;i<10;i++) | |
41 | + remplissage(&(*arbre),fichier); | |
42 | +} | |
43 | + | |
44 | +void dicos(FILE *fichier){ | |
45 | + char ch[20]; | |
46 | + int i; | |
47 | + if (fichier != NULL){ | |
48 | + FILE *fichierA=fopen("dico/A.txt","w"); | |
49 | + FILE *fichierB=fopen("dico/B.txt","w"); | |
50 | + FILE *fichierC=fopen("dico/C.txt","w"); | |
51 | + FILE *fichierD=fopen("dico/D.txt","w"); | |
52 | + FILE *fichierE=fopen("dico/E.txt","w"); | |
53 | + FILE *fichierF=fopen("dico/F.txt","w"); | |
54 | + FILE *fichierG=fopen("dico/G.txt","w"); | |
55 | + FILE *fichierH=fopen("dico/H.txt","w"); | |
56 | + FILE *fichierI=fopen("dico/I.txt","w"); | |
57 | + FILE *fichierJ=fopen("dico/J.txt","w"); | |
58 | + FILE *fichierK=fopen("dico/K.txt","w"); | |
59 | + FILE *fichierL=fopen("dico/L.txt","w"); | |
60 | + FILE *fichierM=fopen("dico/M.txt","w"); | |
61 | + FILE *fichierN=fopen("dico/N.txt","w"); | |
62 | + FILE *fichierO=fopen("dico/O.txt","w"); | |
63 | + FILE *fichierP=fopen("dico/P.txt","w"); | |
64 | + FILE *fichierQ=fopen("dico/Q.txt","w"); | |
65 | + FILE *fichierR=fopen("dico/R.txt","w"); | |
66 | + FILE *fichierS=fopen("dico/S.txt","w"); | |
67 | + FILE *fichierT=fopen("dico/T.txt","w"); | |
68 | + FILE *fichierU=fopen("dico/U.txt","w"); | |
69 | + FILE *fichierV=fopen("dico/V.txt","w"); | |
70 | + FILE *fichierW=fopen("dico/W.txt","w"); | |
71 | + FILE *fichierX=fopen("dico/X.txt","w"); | |
72 | + FILE *fichierY=fopen("dico/Y.txt","w"); | |
73 | + FILE *fichierZ=fopen("dico/Z.txt","w"); | |
74 | + do{ | |
75 | + int n=strlen(ch); | |
76 | + | |
77 | + if((int)ch[0]==97){ | |
78 | + for(i=0;i<n;i++) | |
79 | + fprintf(fichierA,"%c",ch[i]); | |
80 | + fprintf(fichierA,"%s","\n"); | |
81 | + } | |
82 | + | |
83 | + if((int)ch[0]==98){ | |
84 | + for(i=0;i<n;i++) | |
85 | + fprintf(fichierB,"%c",ch[i]); | |
86 | + fprintf(fichierB,"%s","\n"); | |
87 | + } | |
88 | + | |
89 | + if((int)ch[0]==99){ | |
90 | + for(i=0;i<n;i++) | |
91 | + fprintf(fichierC,"%c",ch[i]); | |
92 | + fprintf(fichierC,"%s","\n"); | |
93 | + } | |
94 | + | |
95 | + if((int)ch[0]==100){ | |
96 | + for(i=0;i<n;i++) | |
97 | + fprintf(fichierD,"%c",ch[i]); | |
98 | + fprintf(fichierD,"%s","\n"); | |
99 | + } | |
100 | + | |
101 | + if((int)ch[0]==101){ | |
102 | + for(i=0;i<n;i++) | |
103 | + fprintf(fichierE,"%c",ch[i]); | |
104 | + fprintf(fichierE,"%s","\n"); | |
105 | + } | |
106 | + | |
107 | + if((int)ch[0]==102){ | |
108 | + for(i=0;i<n;i++) | |
109 | + fprintf(fichierF,"%c",ch[i]); | |
110 | + fprintf(fichierF,"%s","\n"); | |
111 | + } | |
112 | + | |
113 | + if((int)ch[0]==103){ | |
114 | + for(i=0;i<n;i++) | |
115 | + fprintf(fichierG,"%c",ch[i]); | |
116 | + fprintf(fichierG,"%s","\n"); | |
117 | + } | |
118 | + | |
119 | + if((int)ch[0]==104){ | |
120 | + for(i=0;i<n;i++) | |
121 | + fprintf(fichierH,"%c",ch[i]); | |
122 | + fprintf(fichierH,"%s","\n"); | |
123 | + } | |
124 | + | |
125 | + if((int)ch[0]==105){ | |
126 | + for(i=0;i<n;i++) | |
127 | + fprintf(fichierI,"%c",ch[i]); | |
128 | + fprintf(fichierI,"%s","\n"); | |
129 | + } | |
130 | + | |
131 | + if((int)ch[0]==106){ | |
132 | + for(i=0;i<n;i++) | |
133 | + fprintf(fichierJ,"%c",ch[i]); | |
134 | + fprintf(fichierJ,"%s","\n"); | |
135 | + } | |
136 | + | |
137 | + if((int)ch[0]==107){ | |
138 | + for(i=0;i<n;i++) | |
139 | + fprintf(fichierK,"%c",ch[i]); | |
140 | + fprintf(fichierK,"%s","\n"); | |
141 | + } | |
142 | + | |
143 | + if((int)ch[0]==108){ | |
144 | + for(i=0;i<n;i++) | |
145 | + fprintf(fichierL,"%c",ch[i]); | |
146 | + fprintf(fichierL,"%s","\n"); | |
147 | + } | |
148 | + | |
149 | + if((int)ch[0]==109){ | |
150 | + for(i=0;i<n;i++) | |
151 | + fprintf(fichierM,"%c",ch[i]); | |
152 | + fprintf(fichierM,"%s","\n"); | |
153 | + } | |
154 | + | |
155 | + if((int)ch[0]==110){ | |
156 | + for(i=0;i<n;i++) | |
157 | + fprintf(fichierN,"%c",ch[i]); | |
158 | + fprintf(fichierN,"%s","\n"); | |
159 | + } | |
160 | + | |
161 | + if((int)ch[0]==111){ | |
162 | + for(i=0;i<n;i++) | |
163 | + fprintf(fichierO,"%c",ch[i]); | |
164 | + fprintf(fichierO,"%s","\n"); | |
165 | + } | |
166 | + | |
167 | + if((int)ch[0]==112){ | |
168 | + for(i=0;i<n;i++) | |
169 | + fprintf(fichierP,"%c",ch[i]); | |
170 | + fprintf(fichierP,"%s","\n"); | |
171 | + } | |
172 | + | |
173 | + if((int)ch[0]==113){ | |
174 | + for(i=0;i<n;i++) | |
175 | + fprintf(fichierQ,"%c",ch[i]); | |
176 | + fprintf(fichierQ,"%s","\n"); | |
177 | + } | |
178 | + | |
179 | + if((int)ch[0]==114){ | |
180 | + for(i=0;i<n;i++) | |
181 | + fprintf(fichierR,"%c",ch[i]); | |
182 | + fprintf(fichierR,"%s","\n"); | |
183 | + } | |
184 | + | |
185 | + if((int)ch[0]==115){ | |
186 | + for(i=0;i<n;i++) | |
187 | + fprintf(fichierS,"%c",ch[i]); | |
188 | + fprintf(fichierS,"%s","\n"); | |
189 | + } | |
190 | + | |
191 | + if((int)ch[0]==116){ | |
192 | + for(i=0;i<n;i++) | |
193 | + fprintf(fichierT,"%c",ch[i]); | |
194 | + fprintf(fichierT,"%s","\n"); | |
195 | + } | |
196 | + | |
197 | + if((int)ch[0]==117){ | |
198 | + for(i=0;i<n;i++) | |
199 | + fprintf(fichierU,"%c",ch[i]); | |
200 | + fprintf(fichierU,"%s","\n"); | |
201 | + } | |
202 | + | |
203 | + if((int)ch[0]==118){ | |
204 | + for(i=0;i<n;i++) | |
205 | + fprintf(fichierV,"%c",ch[i]); | |
206 | + fprintf(fichierV,"%s","\n"); | |
207 | + } | |
208 | + | |
209 | + if((int)ch[0]==119){ | |
210 | + for(i=0;i<n;i++) | |
211 | + fprintf(fichierW,"%c",ch[i]); | |
212 | + fprintf(fichierW,"%s","\n"); | |
213 | + } | |
214 | + | |
215 | + if((int)ch[0]==120){ | |
216 | + for(i=0;i<n;i++) | |
217 | + fprintf(fichierX,"%c",ch[i]); | |
218 | + fprintf(fichierX,"%s","\n"); | |
219 | + } | |
220 | + | |
221 | + if((int)ch[0]==121){ | |
222 | + for(i=0;i<n;i++) | |
223 | + fprintf(fichierY,"%c",ch[i]); | |
224 | + fprintf(fichierY,"%s","\n"); | |
225 | + } | |
226 | + | |
227 | + if((int)ch[0]==122){ | |
228 | + for(i=0;i<n;i++) | |
229 | + fprintf(fichierZ,"%c",ch[i]); | |
230 | + fprintf(fichierZ,"%s","\n"); | |
231 | + } | |
232 | + | |
233 | + | |
234 | + | |
235 | + } while(fscanf(fichier,"%s",&ch)==1); | |
236 | + | |
237 | + fclose(fichierA); | |
238 | + fclose(fichierB); | |
239 | + fclose(fichierC); | |
240 | + fclose(fichierD); | |
241 | + fclose(fichierE); | |
242 | + fclose(fichierF); | |
243 | + fclose(fichierG); | |
244 | + fclose(fichierH); | |
245 | + fclose(fichierI); | |
246 | + fclose(fichierJ); | |
247 | + fclose(fichierK); | |
248 | + fclose(fichierL); | |
249 | + fclose(fichierM); | |
250 | + fclose(fichierN); | |
251 | + fclose(fichierO); | |
252 | + fclose(fichierP); | |
253 | + fclose(fichierQ); | |
254 | + fclose(fichierR); | |
255 | + fclose(fichierS); | |
256 | + fclose(fichierT); | |
257 | + fclose(fichierU); | |
258 | + fclose(fichierV); | |
259 | + fclose(fichierW); | |
260 | + fclose(fichierX); | |
261 | + fclose(fichierY); | |
262 | + fclose(fichierZ); | |
263 | + | |
264 | + | |
265 | + } | |
266 | + fclose(fichier); | |
267 | +} | |
268 | + | |
269 | +void textes(FILE *file){ | |
270 | + char ch[20]; | |
271 | + int i; | |
272 | + if (file != NULL){ | |
273 | + FILE *fileA=fopen("texte/A.txt","w"); | |
274 | + FILE *fileB=fopen("texte/B.txt","w"); | |
275 | + FILE *fileC=fopen("texte/C.txt","w"); | |
276 | + FILE *fileD=fopen("texte/D.txt","w"); | |
277 | + FILE *fileE=fopen("texte/E.txt","w"); | |
278 | + FILE *fileF=fopen("texte/F.txt","w"); | |
279 | + FILE *fileG=fopen("texte/G.txt","w"); | |
280 | + FILE *fileH=fopen("texte/H.txt","w"); | |
281 | + FILE *fileI=fopen("texte/I.txt","w"); | |
282 | + FILE *fileJ=fopen("texte/J.txt","w"); | |
283 | + FILE *fileK=fopen("texte/K.txt","w"); | |
284 | + FILE *fileL=fopen("texte/L.txt","w"); | |
285 | + FILE *fileM=fopen("texte/M.txt","w"); | |
286 | + FILE *fileN=fopen("texte/N.txt","w"); | |
287 | + FILE *fileO=fopen("texte/O.txt","w"); | |
288 | + FILE *fileP=fopen("texte/P.txt","w"); | |
289 | + FILE *fileQ=fopen("texte/Q.txt","w"); | |
290 | + FILE *fileR=fopen("texte/R.txt","w"); | |
291 | + FILE *fileS=fopen("texte/S.txt","w"); | |
292 | + FILE *fileT=fopen("texte/T.txt","w"); | |
293 | + FILE *fileU=fopen("texte/U.txt","w"); | |
294 | + FILE *fileV=fopen("texte/V.txt","w"); | |
295 | + FILE *fileW=fopen("texte/W.txt","w"); | |
296 | + FILE *fileX=fopen("texte/X.txt","w"); | |
297 | + FILE *fileY=fopen("texte/Y.txt","w"); | |
298 | + FILE *fileZ=fopen("texte/Z.txt","w"); | |
299 | + do{ | |
300 | + int n=strlen(ch); | |
301 | + | |
302 | + if((int)ch[0]==97){ | |
303 | + for(i=0;i<n;i++) | |
304 | + fprintf(fileA,"%c",ch[i]); | |
305 | + fprintf(fileA,"%s","\n"); | |
306 | + } | |
307 | + | |
308 | + if((int)ch[0]==98){ | |
309 | + for(i=0;i<n;i++) | |
310 | + fprintf(fileB,"%c",ch[i]); | |
311 | + fprintf(fileB,"%s","\n"); | |
312 | + } | |
313 | + | |
314 | + if((int)ch[0]==99){ | |
315 | + for(i=0;i<n;i++) | |
316 | + fprintf(fileC,"%c",ch[i]); | |
317 | + fprintf(fileC,"%s","\n"); | |
318 | + } | |
319 | + | |
320 | + if((int)ch[0]==100){ | |
321 | + for(i=0;i<n;i++) | |
322 | + fprintf(fileD,"%c",ch[i]); | |
323 | + fprintf(fileD,"%s","\n"); | |
324 | + } | |
325 | + | |
326 | + if((int)ch[0]==101){ | |
327 | + for(i=0;i<n;i++) | |
328 | + fprintf(fileE,"%c",ch[i]); | |
329 | + fprintf(fileE,"%s","\n"); | |
330 | + } | |
331 | + | |
332 | + if((int)ch[0]==102){ | |
333 | + for(i=0;i<n;i++) | |
334 | + fprintf(fileF,"%c",ch[i]); | |
335 | + fprintf(fileF,"%s","\n"); | |
336 | + } | |
337 | + | |
338 | + if((int)ch[0]==103){ | |
339 | + for(i=0;i<n;i++) | |
340 | + fprintf(fileG,"%c",ch[i]); | |
341 | + fprintf(fileG,"%s","\n"); | |
342 | + } | |
343 | + | |
344 | + if((int)ch[0]==104){ | |
345 | + for(i=0;i<n;i++) | |
346 | + fprintf(fileH,"%c",ch[i]); | |
347 | + fprintf(fileH,"%s","\n"); | |
348 | + } | |
349 | + | |
350 | + if((int)ch[0]==105){ | |
351 | + for(i=0;i<n;i++) | |
352 | + fprintf(fileI,"%c",ch[i]); | |
353 | + fprintf(fileI,"%s","\n"); | |
354 | + } | |
355 | + | |
356 | + if((int)ch[0]==106){ | |
357 | + for(i=0;i<n;i++) | |
358 | + fprintf(fileJ,"%c",ch[i]); | |
359 | + fprintf(fileJ,"%s","\n"); | |
360 | + } | |
361 | + | |
362 | + if((int)ch[0]==107){ | |
363 | + for(i=0;i<n;i++) | |
364 | + fprintf(fileK,"%c",ch[i]); | |
365 | + fprintf(fileK,"%s","\n"); | |
366 | + } | |
367 | + | |
368 | + if((int)ch[0]==108){ | |
369 | + for(i=0;i<n;i++) | |
370 | + fprintf(fileL,"%c",ch[i]); | |
371 | + fprintf(fileL,"%s","\n"); | |
372 | + } | |
373 | + | |
374 | + if((int)ch[0]==109){ | |
375 | + for(i=0;i<n;i++) | |
376 | + fprintf(fileM,"%c",ch[i]); | |
377 | + fprintf(fileM,"%s","\n"); | |
378 | + } | |
379 | + | |
380 | + if((int)ch[0]==110){ | |
381 | + for(i=0;i<n;i++) | |
382 | + fprintf(fileN,"%c",ch[i]); | |
383 | + fprintf(fileN,"%s","\n"); | |
384 | + } | |
385 | + | |
386 | + if((int)ch[0]==111){ | |
387 | + for(i=0;i<n;i++) | |
388 | + fprintf(fileO,"%c",ch[i]); | |
389 | + fprintf(fileO,"%s","\n"); | |
390 | + } | |
391 | + | |
392 | + if((int)ch[0]==112){ | |
393 | + for(i=0;i<n;i++) | |
394 | + fprintf(fileP,"%c",ch[i]); | |
395 | + fprintf(fileP,"%s","\n"); | |
396 | + } | |
397 | + | |
398 | + if((int)ch[0]==113){ | |
399 | + for(i=0;i<n;i++) | |
400 | + fprintf(fileQ,"%c",ch[i]); | |
401 | + fprintf(fileQ,"%s","\n"); | |
402 | + } | |
403 | + | |
404 | + if((int)ch[0]==114){ | |
405 | + for(i=0;i<n;i++) | |
406 | + fprintf(fileR,"%c",ch[i]); | |
407 | + fprintf(fileR,"%s","\n"); | |
408 | + } | |
409 | + | |
410 | + if((int)ch[0]==115){ | |
411 | + for(i=0;i<n;i++) | |
412 | + fprintf(fileS,"%c",ch[i]); | |
413 | + fprintf(fileS,"%s","\n"); | |
414 | + } | |
415 | + | |
416 | + if((int)ch[0]==116){ | |
417 | + for(i=0;i<n;i++) | |
418 | + fprintf(fileT,"%c",ch[i]); | |
419 | + fprintf(fileT,"%s","\n"); | |
420 | + } | |
421 | + | |
422 | + if((int)ch[0]==117){ | |
423 | + for(i=0;i<n;i++) | |
424 | + fprintf(fileU,"%c",ch[i]); | |
425 | + fprintf(fileU,"%s","\n"); | |
426 | + } | |
427 | + | |
428 | + if((int)ch[0]==118){ | |
429 | + for(i=0;i<n;i++) | |
430 | + fprintf(fileV,"%c",ch[i]); | |
431 | + fprintf(fileV,"%s","\n"); | |
432 | + } | |
433 | + | |
434 | + if((int)ch[0]==119){ | |
435 | + for(i=0;i<n;i++) | |
436 | + fprintf(fileW,"%c",ch[i]); | |
437 | + fprintf(fileW,"%s","\n"); | |
438 | + } | |
439 | + | |
440 | + if((int)ch[0]==120){ | |
441 | + for(i=0;i<n;i++) | |
442 | + fprintf(fileX,"%c",ch[i]); | |
443 | + fprintf(fileX,"%s","\n"); | |
444 | + } | |
445 | + | |
446 | + if((int)ch[0]==121){ | |
447 | + for(i=0;i<n;i++) | |
448 | + fprintf(fileY,"%c",ch[i]); | |
449 | + fprintf(fileY,"%s","\n"); | |
450 | + } | |
451 | + | |
452 | + if((int)ch[0]==122){ | |
453 | + for(i=0;i<n;i++) | |
454 | + fprintf(fileZ,"%c",ch[i]); | |
455 | + fprintf(fileZ,"%s","\n"); | |
456 | + } | |
457 | + | |
458 | + | |
459 | + | |
460 | + } while(fscanf(file,"%s",&ch)==1); | |
461 | + | |
462 | + fclose(fileA); | |
463 | + fclose(fileB); | |
464 | + fclose(fileC); | |
465 | + fclose(fileD); | |
466 | + fclose(fileE); | |
467 | + fclose(fileF); | |
468 | + fclose(fileG); | |
469 | + fclose(fileH); | |
470 | + fclose(fileI); | |
471 | + fclose(fileJ); | |
472 | + fclose(fileK); | |
473 | + fclose(fileL); | |
474 | + fclose(fileM); | |
475 | + fclose(fileN); | |
476 | + fclose(fileO); | |
477 | + fclose(fileP); | |
478 | + fclose(fileQ); | |
479 | + fclose(fileR); | |
480 | + fclose(fileS); | |
481 | + fclose(fileT); | |
482 | + fclose(fileU); | |
483 | + fclose(fileV); | |
484 | + fclose(fileW); | |
485 | + fclose(fileX); | |
486 | + fclose(fileY); | |
487 | + fclose(fileZ); | |
488 | + | |
489 | + | |
490 | + } | |
491 | + fclose(file); | |
492 | +} | |
493 | + | |
494 | +void ascii(int tab[],char ch[]){ | |
495 | + int n=strlen(ch); | |
496 | + int i=0; | |
497 | + for(i=0;i<n;i++) | |
498 | + tab[i]=(int)ch[i]; | |
499 | +} | |
500 | + | |
501 | +//mettre en place un algorithme de recherche | |
502 | +int existe(noeud * arbre, char ch){ | |
503 | + if ((int)ch==arbre->valeur) | |
504 | + return 1; | |
505 | + else | |
506 | + return 0; | |
507 | +} | |
508 | +/* | |
509 | +bool repeat(noeud * arbre,char ch[]){ | |
510 | + int cpt=0; | |
511 | + int n=strlen(ch); | |
512 | + int i; | |
513 | + for(i=0;i<n;i++){ | |
514 | + if(ch[i]='a') | |
515 | + cpt=cpt+existe(arbre->a,ch[i]); | |
516 | + } | |
517 | + if(cpt==n) | |
518 | + return 1; | |
519 | + else | |
520 | + return 0; */ | |
521 | + | |
522 | + | |
523 | + | |
524 | + | |
525 | + | |
526 | + | |
527 | + | |
528 | +//void verification(noeud ** arbre, FILE *fichier){ | |
529 | + // char ch[20] | |
530 | + | |
531 | +// do{ | |
532 | + // existe(&(*arbre),ch); | |
533 | + //}while(fscanf(file,"%s",&ch)==1); | |
534 | + | |
535 | +int main(){ | |
536 | + | |
537 | + | |
538 | + | |
539 | + noeud *ArbreA = NULL; | |
540 | + noeud *ArbreB = NULL; | |
541 | + noeud *ArbreC = NULL; | |
542 | + noeud *ArbreD = NULL; | |
543 | + noeud *ArbreE = NULL; | |
544 | + noeud *ArbreF = NULL; | |
545 | + noeud *ArbreG = NULL; | |
546 | + noeud *ArbreH = NULL; | |
547 | + noeud *ArbreI = NULL; | |
548 | + noeud *ArbreJ = NULL; | |
549 | + noeud *ArbreK = NULL; | |
550 | + noeud *ArbreL = NULL; | |
551 | + noeud *ArbreM = NULL; | |
552 | + noeud *ArbreN = NULL; | |
553 | + noeud *ArbreO = NULL; | |
554 | + noeud *ArbreP = NULL; | |
555 | + noeud *ArbreQ = NULL; | |
556 | + noeud *ArbreR = NULL; | |
557 | + noeud *ArbreS = NULL; | |
558 | + noeud *ArbreT = NULL; | |
559 | + noeud *ArbreU = NULL; | |
560 | + noeud *ArbreV = NULL; | |
561 | + noeud *ArbreW = NULL; | |
562 | + noeud *ArbreX = NULL; | |
563 | + noeud *ArbreY = NULL; | |
564 | + noeud *ArbreZ = NULL; | |
565 | + | |
566 | + | |
567 | + FILE *dico=fopen("dico/dico.txt","r"); | |
568 | + | |
569 | + FILE *fichierA=fopen("dico/A.txt","r"); | |
570 | + FILE *fichierB=fopen("dico/B.txt","r"); | |
571 | + FILE *fichierC=fopen("dico/C.txt","r"); | |
572 | + FILE *fichierD=fopen("dico/D.txt","r"); | |
573 | + FILE *fichierE=fopen("dico/E.txt","r"); | |
574 | + FILE *fichierF=fopen("dico/F.txt","r"); | |
575 | + FILE *fichierG=fopen("dico/G.txt","r"); | |
576 | + FILE *fichierH=fopen("dico/H.txt","r"); | |
577 | + FILE *fichierI=fopen("dico/I.txt","r"); | |
578 | + FILE *fichierJ=fopen("dico/J.txt","r"); | |
579 | + FILE *fichierK=fopen("dico/K.txt","r"); | |
580 | + FILE *fichierL=fopen("dico/L.txt","r"); | |
581 | + FILE *fichierM=fopen("dico/M.txt","r"); | |
582 | + FILE *fichierN=fopen("dico/N.txt","r"); | |
583 | + FILE *fichierO=fopen("dico/O.txt","r"); | |
584 | + FILE *fichierP=fopen("dico/P.txt","r"); | |
585 | + FILE *fichierQ=fopen("dico/Q.txt","r"); | |
586 | + FILE *fichierR=fopen("dico/R.txt","r"); | |
587 | + FILE *fichierS=fopen("dico/S.txt","r"); | |
588 | + FILE *fichierT=fopen("dico/T.txt","r"); | |
589 | + FILE *fichierU=fopen("dico/U.txt","r"); | |
590 | + FILE *fichierV=fopen("dico/V.txt","r"); | |
591 | + FILE *fichierW=fopen("dico/W.txt","r"); | |
592 | + FILE *fichierX=fopen("dico/X.txt","r"); | |
593 | + FILE *fichierY=fopen("dico/Y.txt","r"); | |
594 | + FILE *fichierZ=fopen("dico/Z.txt","r"); | |
595 | + | |
596 | + | |
597 | + dicos(dico); | |
598 | + remplissage(&ArbreA,fichierA); | |
599 | + printf("apres remplissage\n"); | |
600 | + | |
601 | + | |
602 | +/* | |
603 | + | |
604 | + lecture(&ArbreA,fichierA); | |
605 | + lecture(&ArbreB,fichierB); | |
606 | + lecture(&ArbreC,fichierC); | |
607 | + lecture(&ArbreD,fichierD); | |
608 | + lecture(&ArbreE,fichierE); | |
609 | + lecture(&ArbreF,fichierF); | |
610 | + lecture(&ArbreG,fichierG); | |
611 | + lecture(&ArbreH,fichierH); | |
612 | + lecture(&ArbreI,fichierI); | |
613 | + lecture(&ArbreJ,fichierJ); | |
614 | + lecture(&ArbreK,fichierK); | |
615 | + lecture(&ArbreL,fichierL); | |
616 | + lecture(&ArbreM,fichierM); | |
617 | + lecture(&ArbreN,fichierN); | |
618 | + lecture(&ArbreO,fichierO); | |
619 | + lecture(&ArbreP,fichierP); | |
620 | + lecture(&ArbreQ,fichierQ); | |
621 | + lecture(&ArbreR,fichierR); | |
622 | + lecture(&ArbreS,fichierS); | |
623 | + lecture(&ArbreT,fichierT); | |
624 | + lecture(&ArbreU,fichierU); | |
625 | + lecture(&ArbreV,fichierV); | |
626 | + lecture(&ArbreW,fichierW); | |
627 | + lecture(&ArbreX,fichierX); | |
628 | + lecture(&ArbreY,fichierY); | |
629 | + lecture(&ArbreZ,fichierZ); | |
630 | +*/ | |
631 | + | |
632 | + | |
633 | + | |
634 | + fclose(dico); | |
635 | + | |
636 | + fclose(fichierA); | |
637 | + fclose(fichierB); | |
638 | + fclose(fichierC); | |
639 | + fclose(fichierD); | |
640 | + fclose(fichierE); | |
641 | + fclose(fichierF); | |
642 | + fclose(fichierG); | |
643 | + fclose(fichierH); | |
644 | + fclose(fichierI); | |
645 | + fclose(fichierJ); | |
646 | + fclose(fichierK); | |
647 | + fclose(fichierL); | |
648 | + fclose(fichierM); | |
649 | + fclose(fichierN); | |
650 | + fclose(fichierO); | |
651 | + fclose(fichierP); | |
652 | + fclose(fichierQ); | |
653 | + fclose(fichierR); | |
654 | + fclose(fichierS); | |
655 | + fclose(fichierT); | |
656 | + fclose(fichierU); | |
657 | + fclose(fichierV); | |
658 | + fclose(fichierW); | |
659 | + fclose(fichierX); | |
660 | + fclose(fichierY); | |
661 | + fclose(fichierZ); | |
662 | + | |
663 | + printf("apres fclose\n"); | |
664 | +/* | |
665 | + FILE *texte=fopen("texte/texte.txt","r"); | |
666 | + textes(texte); | |
667 | + fclose(texte); | |
668 | + | |
669 | + FILE *corrige = fopen("fautes.txt","w"); | |
670 | + fclose(corrige); */ | |
671 | + printf("Ici\n"); | |
672 | + printf("il existe "); | |
673 | + printf(": %d en valeur",ArbreA->valeur); | |
674 | + printf("apres\n"); | |
675 | +// int i,n=strlen(ch) existe(&(*ArbreA->e),'e') | |
676 | +// int tab[n]; | |
677 | +// ascii(tab,ch); | |
678 | +// for(i=0;i<n;i++) | |
679 | +// printf("%d\n",tab[i]); | |
680 | + | |
681 | + | |
682 | + return 0; | |
683 | + | |
684 | + | |
685 | +} | ... | ... |