L3peha

гавно а не жизнь

Dec 8th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <io.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. string str;
  12. vector <char> text;
  13. ifstream is;
  14. cin >> str;
  15. is.open(str);
  16.  
  17. int n = 0;
  18. for (int i = 0; !is.eof(); i++)
  19. {
  20. char s;
  21. s = is.get();
  22. text.push_back(s);
  23. n++;
  24. }
  25. is.close();
  26.  
  27. for (int j = 0; j < n; j++)
  28. {
  29. if ((text[j] >= 'n' || text[j] <= 'z') && (text[j] >= 'N' || text[j] <= 'Z'))
  30. {
  31. text[j] -= 13;
  32. }
  33. if (text[j] < 'n' || text[j] >= 'a')
  34. {
  35. text[j] = text[j] + (13 - (text[j] - 'a'));
  36. }
  37. if (text[j] < 'N' || text[j] >= 'A')
  38. {
  39. text[j] = text[j] + (13 - (text[j] - 'A'));
  40. }
  41. }
  42. for (int j = 0; j < n; j++)
  43. {
  44. cout << text[j];
  45. }
  46. return 0;
  47. }
Add Comment
Please, Sign In to add comment