Created
June 6, 2018 16:30
-
-
Save DuckSoft/9f20717b247029b80c775e3638fbb49e to your computer and use it in GitHub Desktop.
Nowcoder 句子反转
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 垃圾思路 | |
#include <vector> | |
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
int main() { | |
stringstream ss; | |
vector<string> fucker; | |
string str; while (getline(cin, str)) { | |
ss << str; fucker.clear(); | |
while (ss >> str) { | |
fucker.push_back(str); | |
} | |
bool first; first = true; | |
for (auto i = fucker.rbegin(); i != fucker.rend(); ++i) { | |
first = (first ? false : (cout << ' ', false)); | |
cout << *i; | |
} | |
cout << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment