fork download
  1. #include <iostream>
  2. #include <cctype>
  3. using namespace std;
  4.  
  5. int main() {
  6. int k;
  7. char n;
  8. cin >> k >> n;
  9.  
  10. if (islower(n)){
  11. cout << (char)((n - 'a' + k)%26 + 'a') << endl;
  12. }
  13.  
  14. if (isupper(n)){
  15. cout << (char)((n - 'A' + k)%26 + 'A') << endl;
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5232KB
stdin
5
Z
stdout
E