View Code of Problem 114

	#include<stdio.h>
#include <string.h>
#include <math.h>
void d(char s[])
{
	int i;
	for(i=strlen(s)-1;i>=0;i--)
		printf("%c",s[i]);
}

void main()
{
	int i,j,sum=0;
	char a[100],b[100];
	while(gets(a)!=NULL)
	{
	for(i=0;i<strlen(a);i++)
	{
		if (a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')
		{
		j=0;
		while(a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')
		{
			b[j]=a[i];
			i++;
			j++;
		}
		b[j]='\0';
		d(b);
		b[0]='\0';
		i--;
		}
		else
			printf("%c",a[i]);
	}
	printf("\n");
	}
	
    
}


Double click to view unformatted code.


Back to problem 114