reacc_bdlex2win.c
2.23 KB
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
107
108
/* Affiche avec les accents */
#include <stdio.h>
void accent_mot(ch)
char *ch;
{
char temp[90000];
int i,n;
for(n=0,i=0;ch[n];n++)
{
switch (ch[n+1])
{
case '1' :
switch (ch[n])
{
case 'e' : temp[i++]='é'; n++; break;
case 'E' : temp[i++]='É'; n++; break;
default : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
}
break;
case '2' :
switch (ch[n])
{
case 'a' : temp[i++]='ŕ'; n++; break;
case 'A' : temp[i++]='Ŕ'; n++; break;
case 'e' : temp[i++]='č'; n++; break;
case 'E' : temp[i++]='Č'; n++; break;
case 'u' : temp[i++]='ů'; n++; break;
case 'U' : temp[i++]='Ů'; n++; break;
default : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
}
break;
case '3' :
switch (ch[n])
{
case 'a' : temp[i++]='â'; n++; break;
case 'A' : temp[i++]='Â'; n++; break;
case 'e' : temp[i++]='ę'; n++; break;
case 'E' : temp[i++]='Ę'; n++; break;
case 'i' : temp[i++]='î'; n++; break;
case 'I' : temp[i++]='Î'; n++; break;
case 'o' : temp[i++]='ô'; n++; break;
case 'O' : temp[i++]='Ô'; n++; break;
case 'u' : temp[i++]='ű'; n++; break;
case 'U' : temp[i++]='Ű'; n++; break;
default : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
}
break;
case '4' :
switch (ch[n])
{
case 'a' : temp[i++]='ä'; n++; break;
case 'A' : temp[i++]='Ä'; n++; break;
case 'e' : temp[i++]='ë'; n++; break;
case 'E' : temp[i++]='Ë'; n++; break;
case 'i' : temp[i++]='ď'; n++; break;
case 'I' : temp[i++]='Ď'; n++; break;
case 'o' : temp[i++]='ö'; n++; break;
case 'O' : temp[i++]='Ö'; n++; break;
case 'u' : temp[i++]='ü'; n++; break;
case 'U' : temp[i++]='Ü'; n++; break;
default : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
}
break;
case '5' :
switch (ch[n])
{
case 'c' : temp[i++]='ç'; n++; break;
case 'C' : temp[i++]='Ç'; n++; break;
default : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
}
break;
case 'Ć' :
temp[i++]='Ó';
n++;
break;
case '°' :
temp[i++]='ł';
n++;
break;
default :
{
if ((ch[n]=='\\')&&((ch[n+1]=='\\')||((ch[n+1]>='1')&&(ch[n+1]<='5')))) n++;
temp[i++]=ch[n];
}
}
}
temp[i]='\0';
strcpy(ch,temp);
}
int main(argc,argv)
int argc;
char **argv;
{
char mot[80000];
while (fgets(mot,80000,stdin))
{
accent_mot(mot);
printf("%s",mot);
}
return 0;
}