//输入“how are you"倒序输出"you are how"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str; //字符串
int ptr[100];
while (getline(cin, str))
{
int n = str.size();
int count=0; //空格数量
int b = n;
//统计字符串中空格数量
for (int i = 0; i < n; i++)
{
if (str[i] == ' ')
{
ptr[count] = i;
cout << "ptr[count]:" << ptr[count] << endl;
cout << "str[count]:" << str[ptr[count]-1] << endl;
count++;
}
}
cout << "count = " << count << endl;
count--;
//倒序输出单词
for (int j = n ; j >= 0; j--)
{
if (j == ptr[count] && count >=