Advertisement
L3peha

Untitled

Dec 8th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <fstream>
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. ifstream fin;
  8. string name;
  9. cin >> name;
  10. char c;
  11. fin.open(name);
  12. while ((c = fin.get()) != EOF) {
  13. if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
  14. {
  15. if (c + 13 > 'z')
  16. {
  17. c = c + 12 - 'z' + 'a';
  18. }
  19. else {
  20. if (c + 13 > 'Z' && c < 'a')
  21. {
  22. c = c + 12 - 'Z' + 'A';
  23. }
  24. else {
  25. c = c + 13;
  26. }
  27. }
  28. }
  29. cout << c;
  30. }
  31. fin.close();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement