Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);cout.tie(0);
- test
- {
- string a,c;
- ll i,j,k,l,h;
- cin>>a;
- c=a;
- char x;
- reverse(c.begin(),c.end());
- for(i=0;i<a.size();i++)
- {
- l=a[i]-96;
- k=c[i]-96;
- if(k+l==26) h=26;
- else if(k+l>26) h=(k+l)-26;
- else h=k+l;
- x='a'+h-1;
- cout<<x;
- }
- cout<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment