请补充下列代码完成string过滤空格的循环输入:string s;while______ coutsendl;
string s; while (getline(cin, s)) { // 过滤空格 s.erase(remove(s.begin(), s.end(), ' '), s.end()); cout << s << endl; }
原文地址: https://www.cveoy.top/t/topic/hVjU 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
string s; while (getline(cin, s)) { // 过滤空格 s.erase(remove(s.begin(), s.end(), ' '), s.end()); cout << s << endl; }
原文地址: https://www.cveoy.top/t/topic/hVjU 著作权归作者所有。请勿转载和采集!