#include<bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ string p=""; for(int i=0;i<s.length();i++){ if(isalpha(s[i])){ p=s[i]+p; } else{ cout<<p<<s[i]; p.clear(); } } cout<<p<<endl; } } |
Double click to view unformatted code.