题解 | #句子逆序#
句子逆序
http://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
无脑调用标准库
#include<iostream>
#include<vector>
#include<algorithm>
int main(int argc, char const *argv[])
{
std::vector<std::string> snum;
std::string stmp;
while (std::cin >> stmp)
{
snum.push_back(stmp);
}
std::reverse(snum.begin(), snum.end());
for (auto s : snum)
{
std::cout << s << " ";
}
return 0;
}