题解 | #句子逆序#
句子逆序
https://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
#include <iostream> #include <string> using namespace std; int main(){ string str, ans; while(cin >> str){ str = str + " " + ans; ans = str; } cout << ans; return 0; }
吐槽一下这个输出的判断,离谱的一笔,有没有大佬解答一下