题解 | #句子逆序#
句子逆序
https://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
#include <iostream> using namespace std; int main() { string s, res; while(cin >> s) { s = s + " " + res; res = s; } cout << res << endl; return 0; }
句子逆序
https://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
#include <iostream> using namespace std; int main() { string s, res; while(cin >> s) { s = s + " " + res; res = s; } cout << res << endl; return 0; }
相关推荐