Josif_tepe

Untitled

Oct 15th, 2025
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <queue>
  4. #include <vector>
  5. #include <cstring>
  6. using namespace std;
  7.  
  8. int main() {
  9.     int x;
  10.     cin >> x;
  11.    
  12.     string s;
  13.     cin >> s;
  14.    
  15.     for(int i = 0; i < (int) s.size(); i++) {
  16.         int mesto = s[i] - 'a';
  17.         mesto += x;
  18.        
  19.         if(mesto > 25) {
  20.             mesto = 25 - (mesto - 25);
  21.         }
  22.        
  23.        
  24.         char c = mesto + 'a';
  25.        
  26.         cout << c;
  27.     }
  28.     cout << endl;
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment