using namespace std;
void reverse(char a[],int slen, int elen)
{
int start,end,temp;
for(start=slen,end=elen;start<end;start++,end--)
{
temp=a[start];
a[start]=a[end];
a[end]=temp;
}
}
void reverseall(char b[])
{
char a[15];
int i,j,n=0,len;
for(i=14,j=0;i>=0,j<15;i--,j++)
a[j]=b[i];
i=0;
j=0;
while(a[i]!='\0')
{cout<<"h";
n++;
i++;
}
while(j!=n)
{
if(j!=0)
j++;
len=0;
while(a[j]!= ' ' && a[j]!='\0')
{
len++;
j++;
}
reverse(a,j-len,j-1);
}
for(i=0;i<n;i++)
cout<<a[i];
}
int main()
{
char b[20]="hi how are you";
reverseall(b);
return 0;
}