#include<stdio.h>
int main() {
char str[50],temp;
int i,j,k=0;
gets(str);
for(i=0;str[i]!='\0';i++){
if(str[i]== ' ' || str[i+1]=='\0'){
if(str[i]==' ')
j = i-1;
if(str[i+1]=='\0')
j = i;
for(;k<=j;k++,j--){
temp = str[k];
str[k] = str[j];
str[j] = temp;
}
if(str[i]==' ')
str[i] = ' ';
k=i+1;
}
}
str[i] = '\0';
puts(str);
}
int main() {
char str[50],temp;
int i,j,k=0;
gets(str);
for(i=0;str[i]!='\0';i++){
if(str[i]== ' ' || str[i+1]=='\0'){
if(str[i]==' ')
j = i-1;
if(str[i+1]=='\0')
j = i;
for(;k<=j;k++,j--){
temp = str[k];
str[k] = str[j];
str[j] = temp;
}
if(str[i]==' ')
str[i] = ' ';
k=i+1;
}
}
str[i] = '\0';
puts(str);
}
Hello developers how are you
olleh srepoleved woh era uoy