#include <string.h>
#include <stdio.h>
#include <ctype.h>
int main()
{
char str[128], res[10][128];
int i, j = 0, k = 0;
puts("please input a string");
gets(str);
for (i = 0; str[i] != '\0'; i++)
{
if (str[i] == ' ')
{
j++;
k = 0;
continue;
}
res[j][k] = str[i];
k++;
}
for (i = j; i >= 0; i--)
{
printf("%s ", res[i]);
}
return 0;
}
please input a string
hello Eq
Eq hello