1 #include"iostream" 2 #include"string" 3 #include"vector" 4 #include"sstream" 5 #include"stdio.h" 6 using namespace std; 7 8 int main() 9 { 10 string str; 11 vector<string> word; 12 string res; 13 14 while(getline(cin,str)) 15 { 16 word.clear(); 17 stringstream input(str); 18 while(input>>res) 19 { 20 word.push_back(res); 21 } 22 for(int i=word.size()-1;i>0;i--) 23 cout<<word[i]<<" "; 24 cout<<word[0]<<endl; 25 } 26 return 0; 27 }