j'ai met quelque modification sur mon programme et il devient non fonctionnel (pas des mesage d'erreur ) mais il sort tout seul meme apres mettre getch() et getchar() et getche().

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
 
#include<stdio.h>
#include<string.h>
#include<conio.h>
 
 int main(void)
{
char l1[50],l2[50],l3[50],l4[50], lettre[256];
char *espace = " ",choix = 'o';
char unite[25][25]={"end","un","deux","trois","quatre", "cinq", "six", "sept", "huit","neuf","dix","onze","douze","treize","quatorze","quinze","seize","dix-sept","dix-huit","dix-neuf"};
char dizaine[25][25]={"","","vingt","trente","quarante","cinquante","soixante","","quatre-vingt",""};
char centaine[3][6]={"end","cent","cents"};
int i,x1=0,x2=0,x3=0,x4=0, plage;
strcpy(lettre,"");
while((choix=='o')||(choix=='O'))
 {
  printf("donner la plage de votre nombre");
  printf("\n1 pour des nombre entre [101-1999]");
  printf("\n2 pour [20-99]");
  printf("\n3 pour [1-19]\n");
  scanf("%d",plage);
  switch(plage)
  {
  case 1 :                              
{printf("donner une chiffre literalement\n");
scanf("%s",&l1);
scanf("%s",&l2);
scanf("%s",&l3);
scanf("%s",&l4);
 
strcat(lettre,l1);
strcat(lettre,espace);
strcat(lettre,l2);
strcat(lettre,espace);
strcat(lettre,l3);
strcat(lettre,espace);
strcat(lettre,l4);
 
printf("%s\n",lettre);
 
for(i=0;i<25 || (strcmp(l1,unite[i])==0) ;i++)
if (strcmp(l1,unite[i])==0)
x1=i;
 
for(i=0;i<25 || (strcmp(l2,centaine[i])==0) ;i++)
if (strcmp(l2,centaine[i])==0)
x2=100;
 
for(i=0;i<25 || (strcmp(l3,dizaine[i])==0) ;i++)
if (strcmp(l3,dizaine[i])==0)
x3=10*i;
 
for(i=0;i<30 || (strcmp(l4,unite[i])==0) ;i++)
if (strcmp(l4,unite[i])==0)
x4=i;
}
 
 
break;
 
case 2 :
{printf("donner une chiffre literalement\n");
 
scanf("%s",&l3);
scanf("%s",&l4);
 
 
strcat(lettre,l3);
strcat(lettre,espace);
strcat(lettre,l4);
 
printf("%s\n",lettre);}
 
 
 
for(i=0;i<25 || (strcmp(l3,dizaine[i])==0) ;i++)
if (strcmp(l3,dizaine[i])==0)
x3=10*i;
 
for(i=0;i<30 || (strcmp(l4,unite[i])==0) ;i++)
if (strcmp(l4,unite[i])==0)
x4=i;
 
 
break;
 
case 3 :
 printf("donner une chiffre literalement\n");
 scanf("%s",&l4);
 strcat(lettre,l4);
 
printf("%s\n",lettre);
for(i=0;i<30 || (strcmp(l4,unite[i])==0) ;i++)
if (strcmp(l4,unite[i])==0) x4=i;
 
break;
default : printf("choix éroné"); break;
}//end switch
printf(" ca fait :%d  ",x1*x2+x3+x4);
printf("\nEncore d'autre? (O/N): ");
 choix = getche();
 printf("\n===================================================\n");
}//nendwhile
getchar();
return 0;
}
merci d'avance