include <stdio.h>
include <string.h>
int reverse(char *str, int begin, int end)
{
int result = 0;
if(begin < end)
{
result = 1;
return result;
}
char tmp;
while(begin<end)
{
tmp = str[begin];
str[begin] = str[end];
str[end] = str[begin];
end--;
begin++;
}
return result;
}
int main()
{
int begin,end =0
char * str = "i am an handsome boy";
end = strlen(str) -1;
reverse(str, 0, end);
end = 0;
while (str[end] != '\0')
{
while(str[end] != ' ' && str[end] != '\0')
{
end ++;
}
reverse(str, begin, end-1);
while(str[end] == ' ' && str[end] != '\0')
{
end ++;
}
begin = end;
}
printf(str);
return 0 ;
}