Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Text eng translit convert to ru (ANSII), source text write in count.txt file
- #link https://yadi.sk/d/aUXc0unX0tbFQg
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- unsigned char tr[256];
- int main(int argc, char **argv)
- {
- FILE *F1, *F0;
- int c, i, c1, k,p[243],y,qq;
- unsigned char BIG[] = { 192, 193, 150, 196, 197, 212, 195, 150, 200, 201, 202, 203, 204, 205, 206, 207, 150, 208, 209, 210, 211, 194, 150, 150, 219, 199, 199 };
- unsigned char SMALL[] = { 224, 225, 150, 228, 229, 244, 227, 150, 232, 233, 234, 235, 236, 237, 238, 239, 150, 240, 241, 242, 243, 226, 150, 150, 251, 231 };
- unsigned char DTS[] = { 168, 184, 198, 230, 213, 245, 214, 246, 215, 247, 216, 248, 217, 249, 222, 254, 223, 255 };
- for (i = 0; i<65; i++) tr[i] = (unsigned char)i;
- for (i = 65; i<90; i++) tr[i] = BIG[i - 65];
- for (i = 97; i<122; i++) tr[i] = SMALL[i - 97];
- tr[39] = 252;
- tr[90] = 199;
- tr[122] = 231;
- F1 = fopen("count.txt", "r");
- F0 = fopen("trans.txt", "w");
- c1 = 0;
- y = 0;
- k = 0;
- qq = 0;
- while ((c = fgetc(F1)) != EOF)
- {
- if ((c1==0)&&((c == 89) || (c == 121) || (c == 90) || (c == 122) || (c == 75) || (c == 107) || (c == 84) || (c == 116) || (c == 67) || (c == 99) || (c == 83) || (c == 115))){
- c1 = c;
- k = 1;
- }
- else
- if ((c1 != 0) && ((c == 89) || (c == 121) || (c == 90) || (c == 122) || (c == 75) || (c == 107) || (c == 84) || (c == 116) || (c == 67) || (c == 99) || (c == 83) || (c == 115))){
- fputc(tr[c1], F0);
- c1 = c;
- k = 1;
- }
- /////
- if ((k == 1) && (c1 != c) && ((c1 == 89) || (c1 == 121) || (c1 == 90) || (c1 == 122) || (c1 == 75) || (c1 == 107) || (c1 == 84) || (c1 == 116) || (c1 == 67) || (c1 == 99) || (c1==83) || (c1==115)))
- {
- if (c1 == 89)
- {
- if (c == 111)
- {
- fputc(DTS[0], F0);
- y = 1;
- }
- if (c == 117)
- {
- fputc(DTS[14], F0);
- y = 1;
- }
- if (c == 97)
- {
- fputc(DTS[16], F0);
- y = 1;
- }
- }
- else
- if (c1 == 121)
- {
- if (c == 111)
- {
- fputc(DTS[1], F0);
- y = 1;
- }
- if (c == 117)
- {
- fputc(DTS[15], F0);
- y = 1;
- }
- if (c == 97)
- {
- fputc(DTS[17], F0);
- y = 1;
- }
- }
- else
- if (c1 == 90)
- {
- if (c == 104)
- {
- fputc(DTS[2], F0);
- y = 1;
- }
- }
- else
- if (c1 == 122)
- {
- if (c == 104)
- {
- fputc(DTS[3], F0);
- y = 1;
- }
- }
- else
- if (c1 == 75)
- {
- if (c == 104)
- {
- fputc(DTS[4], F0);
- y = 1;
- }
- }
- else
- if (c1 == 107)
- {
- if (c == 104)
- {
- fputc(DTS[5], F0);
- y = 1;
- }
- }
- else
- if (c1 == 84)
- {
- if (c == 115)
- {
- fputc(DTS[6], F0);
- y = 1;
- }
- }
- else
- if (c1 == 116)
- {
- if (c == 115)
- {
- fputc(DTS[7], F0);
- y = 1;
- }
- }
- else
- if (c1 == 67)
- {
- if (c == 104)
- {
- fputc(DTS[8], F0);
- y = 1;
- }
- }
- else
- if (c1 == 99)
- {
- if (c == 104)
- {
- fputc(DTS[9], F0);
- y = 1;
- }
- }
- else
- if (c1 == 83)
- {
- if (c == 104)
- {
- fputc(DTS[10], F0);
- y = 1;
- }
- }
- else
- if (c1 == 115)
- {
- if (c == 104)
- {
- fputc(DTS[11], F0);
- y = 1;
- }
- }
- if (y == 0)
- {
- fputc(tr[c1], F0);
- fputc(tr[c], F0);
- }
- else
- if (y == 1)
- {
- y = 0;
- qq = 1;
- }
- c1 = 0;
- c = 0;
- k = 0;
- qq = 1;
- }
- if ((c1 != c) && (k == 1))
- {
- k = 0;
- fputc(tr[c1], F0);
- }
- if ((k == 0) && (qq == 0))
- fputc(tr[c], F0);
- else
- qq = 0;
- }
- if (k==1)
- fputc(p[c1], F0);
- fclose(F1);
- fclose(F0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement