题解 | #句子逆序#
句子逆序
https://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
// HJ13 句子逆序.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include<bits/stdc++.h> using namespace std; int main() { vector<string>str; string s; while (cin >> s) str.push_back(s); reverse(str.begin(), str.end()); for (auto c : str) cout << c << " "; cout << endl; return 0; }