#include <stdio.h> #include <string.h> #include <math.h> int main(){ char a[1000]; gets(a); int i,j; int temp; 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]!=' '&&temp<strlen(a)){ temp++; } for(j=temp;j>=i;j--){ printf("%c",a[j]); } i=temp+1; } else{ printf("%c",a[i]); i++; } } } |
Double click to view unformatted code.