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