View Code of Problem 114

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
int main()
{
	char a[100];
	while(gets(a)!=NULL)
	{
		int i=0,j,left,right;
		while(!isalpha(a[i]))
		 i++;
		 left=i;
		 while(isalpha(a[i]))
		 i++;
		 right=i-1;
		 for(j=left;j<(left+right)/2;j++)
		 {
		 	char t=a[j];
		 	a[j]=a[left+right-j];
		 	a[left+right-j]=t;
		 }
		 puts(a);
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 114