#include <stdio.h> #include <iostream> #include <string> #include <algorithm> using namespace std; string GetString(string str) { int left=1; string result; for(int i=str.length()-1;i>=0;--i) { if((char)(str[i]+left)>'z') { result.clear(); left=(int)(str[i]+left-(int)'z'); } else { result+=(char)(str[i]+left); left=0; } } return result; } int main(int argc, char **argv) { string str; cout<<"please input one string:"<<endl; while(cin>>str) { str=GetString(str); if(str.length()==0) cout<<"not exist"<<endl; else { reverse(str.begin(),str.end()); cout<<str<<endl; } cout<<"please input one string:"<<endl; } return 0; }