Saleh127

hackerearcth fight2

Sep 28th, 2020 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. test
  11. {
  12.  
  13. string a,c;
  14. ll i,j,k,l,h;
  15. cin>>a;
  16. c=a;
  17. char x;
  18. reverse(c.begin(),c.end());
  19. for(i=0;i<a.size();i++)
  20. {
  21. l=a[i]-96;
  22. k=c[i]-96;
  23. if(k+l==26) h=26;
  24. else if(k+l>26) h=(k+l)-26;
  25. else h=k+l;
  26. x='a'+h-1;
  27. cout<<x;
  28. }
  29. cout<<endl;
  30. }
  31.  
  32.  
  33. return 0;
  34. }
  35.  
Add Comment
Please, Sign In to add comment