View Code of Problem 114

#include<stdio.h>
#include<string.h>
int main()
{
	int i,j,n,l;
	char t;
	char a[100];
	gets(a);
	l=strlen(a);
	for(i=0;i<l;i++)
	{
		if(a[i]!=' ')
		{
		   n=0;
	       for(j=i;j<l;j++)
		   {
			   if(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