#include <iostream> #include <cstdio> #include <iomanip> using namespace std; int main(){ char a[999]; while(cin.getline(a,999)){ int k=0; for(int i=0;i<strlen(a);i++){ k=0; if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')){ for(int j=i;j<strlen(a);j++){ if((a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')) k++; else break; } for(int j=i+k-1;j>=i;j--){ cout<<a[j]; } i=i+k-1; } else cout<<" "; } } return 0; } /* Main.cc: In function 'int main()': Main.cc:9:31: error: 'strlen' was not declared in this scope for(int i=0;i<strlen(a);i++){ ^ */ |
Double click to view unformatted code.