Advertisement
melnikovmaxim

BKV_1_2

Dec 16th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.63 KB | None | 0 0
  1. #Text ru translit convert to translit (ANSII), source text write in count.txt file
  2. #link https://yadi.sk/d/aUXc0unX0tbFQg
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <ctype.h>
  6.  
  7. unsigned char tr[256];
  8. int main(int argc, char **argv)
  9. {
  10.     FILE *F1, *F0;
  11.     int c, i;
  12.     unsigned char BIG[] = "ABVGDE_ZIJKLMNOPRSTUF______Y_E__";
  13.     unsigned char SMALL[] = "abvgde_zijklmnoprstuf______y_e__";
  14.     for (i = 0; i<192; i++) tr[i] = (unsigned char)i;
  15.     for (i = 192; i<224; i++) tr[i] = BIG[i - 192];
  16.     for (i = 224; i<256; i++) tr[i] = SMALL[i - 224];
  17.     F1 = fopen("count.txt", "r");
  18.     F0 = fopen("trans.txt", "w");
  19.     while ((c = fgetc(F1)) != EOF)
  20.     {
  21.         switch (c) {
  22.         case 168: fprintf(F0, "Yo"); continue;
  23.         case 184: fprintf(F0, "yo"); continue;
  24.         case 198: fprintf(F0, "Zh"); continue;
  25.         case 230: fprintf(F0, "zh"); continue;
  26.         case 213: fprintf(F0, "Kh"); continue;
  27.         case 245: fprintf(F0, "kh"); continue;
  28.         case 214: fprintf(F0, "Ts"); continue;
  29.         case 246: fprintf(F0, "ts"); continue;
  30.         case 215: fprintf(F0, "Ch"); continue;
  31.         case 247: fprintf(F0, "ch"); continue;
  32.         case 216: fprintf(F0, "Sh"); continue;
  33.         case 248: fprintf(F0, "sh"); continue;
  34.         case 217: fprintf(F0, "Shch"); continue;
  35.         case 249: fprintf(F0, "shch"); continue;
  36.         case 218: fprintf(F0, "\'"); continue;
  37.         case 250: fprintf(F0, "\'"); continue;
  38.         case 222: fprintf(F0, "Yu"); continue;
  39.         case 254: fprintf(F0, "yu"); continue;
  40.         case 220: fprintf(F0, "\'"); continue;
  41.         case 252: fprintf(F0, "\'"); continue;
  42.         case 223: fprintf(F0, "Ya"); continue;
  43.         case 255: fprintf(F0, "ya"); continue;
  44.  
  45.         }
  46.         fputc(tr[c], F0);
  47.     }
  48.     fclose(F1);
  49.     fclose(F0);
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement