文件目录

#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;
int main()
{
    string s, k;
    getline(cin, s);
    istringstream ss(s);
    int d = 1;
    while (ss >> k)
    {
        reverse(k.begin(), k.end());
        cout << k;
        d += k.size() - 1;
        while (s[d++] == ' ')
            cout << ' ';
    }
    return 0;
}