L3peha

прога сасат

Dec 8th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <stdio.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] >= 'a')|| (text[j] < 'N' && text[j] >= 'A'))
  30. {
  31. text[j] += 13;
  32. }
  33. else if ((text[j] >= 'n' && text[j] <= 'z') || (text[j] >= 'N' && text[j] <= 'Z'))
  34. {
  35. text[j] -= 13;
  36. }
  37. else
  38. {
  39. continue;
  40. }
  41. }
  42. for (int j = 0; j < n-1; j++)
  43. {
  44. if (text[j] == '\n')
  45. {
  46. cout << endl;
  47. }
  48. else
  49. {
  50. cout << text[j];
  51. }
  52. }
  53. return 0;
  54. }
Add Comment
Please, Sign In to add comment