#include<iostream> #include<cstring> using namespace std; int main(){ char a[999]; while(gets(a)){ int k; for(int i=0;i<strlen(a);i++){ k=0; if(isalpha(a[i])){ for(int j=i;j<strlen(a);j++){ if(isalpha(a[j])){ k++; }else break; } for(int j=i+k-1;j>=i;j--){ cout<<a[j]; } i=i+k-1; }else{ cout<<a[i]; } } cout<<endl; } return 0; } |
Double click to view unformatted code.