View Code of Problem 114

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

Double click to view unformatted code.


Back to problem 114