fabbe680

Rot13 & Rot7 v1.0

Nov 29th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string decoded, coded;
  10. char manip;
  11. int y = 0;
  12.  
  13. getline(cin, decoded);
  14.  
  15. coded = decoded;
  16.  
  17. while(y <= decoded.size()) {
  18. for(int i = 0; i <= 4; i++) {
  19. manip = coded[y];
  20. manip += 13;
  21. coded[y] = manip;
  22. y++;
  23. if(y % 5 == 0 && y % 10 != 0) {
  24. for(int u = 0; u <= 4; u++) {
  25. manip = coded[y];
  26. manip += 7;
  27. coded[y] = manip;
  28. y++;
  29. }
  30. }
  31. }
  32. }
  33.  
  34. cout << coded << endl;
  35.  
  36. decoded = coded;
  37. y = 0;
  38.  
  39. while(y <= coded.size()) {
  40. for(int i = 0; i <= 4; i++) {
  41. manip = decoded[y];
  42. manip -= 13;
  43. decoded[y] = manip;
  44. y++;
  45. if(y % 5 == 0 && y % 10 != 0) {
  46. for(int u = 0; u <= 4; u++) {
  47. manip = decoded[y];
  48. manip -= 7;
  49. decoded[y] = manip;
  50. y++;
  51. }
  52. }
  53. }
  54. }
  55.  
  56. cout << decoded << endl;
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment