#include<stdio.h> #include <string.h> #include <math.h> void d(char s[]) { int i; for(i=strlen(s)-1;i>=0;i--) printf("%c",s[i]); } void main() { int i,j,sum=0; char a[100],b[100]; while(gets(a)!=NULL) { for(i=0;i<strlen(a);i++) { j=0; while(a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z') { b[j]=a[i]; i++; j++; } b[j]='\0'; d(b); b[0]='\0'; if(i!=strlen(a)) printf(" "); } } } |
Double click to view unformatted code.