View Code of Problem 114

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

Double click to view unformatted code.


Back to problem 114