fork download
  1. #include<bits/stdc++.h>
  2. using namespace std ;
  3. int main() {
  4. int t ;
  5. cin >> t ;
  6. while( t-- ) {
  7. string s ;
  8. cin >> s ;
  9. for( int i = 0 ; i < s.size() ; i++ ) {
  10. if( i % 2 == 0 ) {
  11. if( s[i] == 'a' )
  12. s[i] = 'b' ;
  13. else
  14. s[i] = 'a' ;
  15. }
  16. else {
  17. if( s[i] == 'z' )
  18. s[i] = 'y' ;
  19. else
  20. s[i] = 'z' ;
  21. }
  22. }
  23. cout << s << endl ;
  24. }
  25.  
  26. return 0 ;
  27. }
  28.  
Success #stdin #stdout 0.04s 5284KB
stdin
Standard input is empty
stdout