fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char c;
  6. long long x;
  7. cin >> c >> x;
  8.  
  9. int p = (c - 'a' - (x % -26) - 26) % -26;
  10.  
  11.  
  12. p = -25 - p;
  13.  
  14. p = (p + (x % -26)) % -26;
  15.  
  16. char r = 'a' + p;
  17. cout << r << endl;
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5328KB
stdin
f
stdout
e