题解 | #字符串连接#
字符串连接
http://www.nowcoder.com/practice/40d83e5509b04d20825ae68fe35e9ca8
#include using namespace std;
int main(){ string s, r; getline(cin, s); for(int i = 0; i < s.size(); i++){ while(s[i] == ' ') i++; if(s[i] != ' '){ r.append(s, i, 1); } } cout << r; return 0; }