Advertisement
georgiy110802

Untitled

Oct 27th, 2021
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. //  ios::sync_with_stdio(0);
  8. //  cin.tie(0);
  9.     map<int, char> mp;
  10.     int ch = -25;
  11.     for(int i = 0; i < 26; i++)
  12.         mp[ch] = char(i + 'a'), ch += 2;
  13.     int n;
  14.     cin >> n;
  15.     string s;
  16.     for(int i = 0; i < n; i++)
  17.         s.push_back('a');
  18.     for(int i = 0; i < n; i++)
  19.     {
  20.         cout << s << endl;
  21.         int before = -1;
  22.         cin >> before;
  23.         if(before == 0)
  24.             return 0;
  25.         s[i] = 'z';
  26.         cout << s << endl;
  27.         int after = -1;
  28.         cin >> after;
  29.         if(after == 0)
  30.             return 0;
  31.         s[i] = mp[before - after];
  32.     }
  33.     cout << s << endl;
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement