#include<iostream> #include<string> using namespace std; int main(){ string s; getline(cin,s); for(int i=0;i<s.length();i++){ string b; int k=0; if(isalpha(s[i])){ while(isalpha(s[i])){ b+=s[i]; i++; k++; } for(int j=k-1;j>=0;j--){ cout<<b[j]; } i--; }else cout<<s[i]; } return 0; } |
Double click to view unformatted code.