View Code of Problem 114

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
	int i,j,n,l;
	char t;
	char a[100];
	while(gets(a)!=NULL)
	{
	    l=strlen(a);
	    for(i=0;i<l;i++)
		{
		    if(isalpha(a[i]))
			{
		         n=0;
	             for(j=i;j<l;j++)
				 {
			     if(isalpha(a[j]))
				    n++;
		 	     else break;
				 }
		   for(j=i+n-1;j>=i;j--)
			   printf("%c",a[j]);
		   i=i+n-1;
			}
		else
			printf("%c",a[i]);
		}
	  printf("\n");
	}
	return 0;

}

Double click to view unformatted code.


Back to problem 114