Advertisement
rjlth

Untitled

May 30th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.82 KB | None | 0 0
  1. //Kapezov Zhandos
  2. #include <iostream>
  3. #include <math.h>
  4. #include <cmath>
  5. #include <vector>
  6. #include <utility>
  7. #include <algorithm>
  8. #include <cstdio>
  9. #include <cstdlib>
  10. #include <fstream>
  11. #include <string>
  12. #include <string.h>
  13. #include <sstream>
  14. #include <map>
  15. #include <set>
  16. #include <stack>
  17. #include <queue>
  18. #include <deque>
  19. #include <limits>
  20. #include <list>
  21. #include <functional>
  22. #include <bitset>
  23. #include <numeric>
  24. #include <iomanip>
  25. #include <ctime>
  26. #include <ctype.h>
  27. #include <clocale>
  28. #include <windows.h>
  29. using namespace std;
  30. typedef long long ll;
  31.  
  32. #define F first
  33. #define S second
  34. #define pb push_back
  35. #define mp make_pair
  36. #define sz size()
  37. #define sqr(x) ((x)*(x))
  38. #define INF numeric_limits<int>::max()
  39.  
  40. int ind[50]={30, 56, 34, 40, 50, 21, 13, 17, 24, 39, 17, 53, 16, 59, 32, 21, 26, 18, 13, 6, 39, 4, 9, 61, 20, 9, 34, 27, 34, 29, 12, 45, 11, 39, 7, 52, 60, 40, 9, 54, 57, 26, 1};
  41. string table[200], s;
  42. string alp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяӘІҢҒҮҰҚӨҺәіңғүұқөһ";
  43. string t;
  44. int n, c;
  45. int main()
  46. {
  47.       SetConsoleCP(1251);// установка кодовой страницы win-cp 1251 в поток ввода
  48.     SetConsoleOutputCP(1251); // установка кодовой страницы win-cp 1251 в поток вывода
  49.     setlocale( LC_ALL,"Russian");
  50.     cin>>s;
  51.     freopen("table.txt", "rt", stdin);
  52.     n=146;
  53.     for (int i=0; i<n; i++) cin>>table[i];
  54.     fclose(stdin);
  55.     for (int i=0; i<s.sz; i++) {
  56.         c=s[i];
  57.         for (int j=0; j<table[ind[i]].sz; j++)
  58.             if (table[ind[i]][j]==s[i]) {
  59.                 c=j;
  60.                 break;
  61.             }
  62.         //c=table[ind[i]].find(s[i]);
  63.         cerr<<c<<" "<<ind[i]<<endl;
  64.         t+=alp[c];
  65.     }
  66.     freopen("output.txt", "wt", stdout);
  67.     cerr<<s;
  68.     cout<<t;
  69.     return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement