rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Solution 483 - Word Scramble

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Solution 483 - Word Scramble

 #include<stdio.h>
#include<string.h>
int main()
{
int l,i,j,b,k;
char n[1000];
while(gets(n))
{
l=strlen(n);
b=-1;
for(i=0;i<l;i++)
 {
 if(n[i]==' ')

 {
 for(j=i-1;j>b;j--)
 printf("%c",n[j]);
 printf(" ");
 b=i;
 }

}

for(i=l-1;i>b;i--)
 printf("%c",n[i]);
printf("\n");
}
return 0;
}

No comments:

Post a Comment