Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Text ru translit convert to translit (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;
- unsigned char BIG[] = "ABVGDE_ZIJKLMNOPRSTUF______Y_E__";
- unsigned char SMALL[] = "abvgde_zijklmnoprstuf______y_e__";
- for (i = 0; i<192; i++) tr[i] = (unsigned char)i;
- for (i = 192; i<224; i++) tr[i] = BIG[i - 192];
- for (i = 224; i<256; i++) tr[i] = SMALL[i - 224];
- F1 = fopen("count.txt", "r");
- F0 = fopen("trans.txt", "w");
- while ((c = fgetc(F1)) != EOF)
- {
- switch (c) {
- case 168: fprintf(F0, "Yo"); continue;
- case 184: fprintf(F0, "yo"); continue;
- case 198: fprintf(F0, "Zh"); continue;
- case 230: fprintf(F0, "zh"); continue;
- case 213: fprintf(F0, "Kh"); continue;
- case 245: fprintf(F0, "kh"); continue;
- case 214: fprintf(F0, "Ts"); continue;
- case 246: fprintf(F0, "ts"); continue;
- case 215: fprintf(F0, "Ch"); continue;
- case 247: fprintf(F0, "ch"); continue;
- case 216: fprintf(F0, "Sh"); continue;
- case 248: fprintf(F0, "sh"); continue;
- case 217: fprintf(F0, "Shch"); continue;
- case 249: fprintf(F0, "shch"); continue;
- case 218: fprintf(F0, "\'"); continue;
- case 250: fprintf(F0, "\'"); continue;
- case 222: fprintf(F0, "Yu"); continue;
- case 254: fprintf(F0, "yu"); continue;
- case 220: fprintf(F0, "\'"); continue;
- case 252: fprintf(F0, "\'"); continue;
- case 223: fprintf(F0, "Ya"); continue;
- case 255: fprintf(F0, "ya"); continue;
- }
- fputc(tr[c], F0);
- }
- fclose(F1);
- fclose(F0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement