#include<bits/stdc++.h>
using namespace std;
int main()
{
string an;
while(getline(cin, an))
{
string ch;
int l = an.size(), i;
for(i=0; i<l; i++)
{
if(an[i] == 32)
{
reverse(ch.begin(), ch.end());
cout << ch << " ";
ch.clear();
}
if(an[i] != 32)
ch += an[i];
}
reverse(ch.begin(), ch.end());
cout << ch << endl;
}
return 0;
}
using namespace std;
int main()
{
string an;
while(getline(cin, an))
{
string ch;
int l = an.size(), i;
for(i=0; i<l; i++)
{
if(an[i] == 32)
{
reverse(ch.begin(), ch.end());
cout << ch << " ";
ch.clear();
}
if(an[i] != 32)
ch += an[i];
}
reverse(ch.begin(), ch.end());
cout << ch << endl;
}
return 0;
}
Comments
Post a Comment