解题思路:
注意事项:
参考代码:
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
vector<char> c[10];
vector<char>::iterator it;
string str;
while (getline(cin, str)) {
for (int i = 0; i < str.size(); i++)
{
c->push_back(str[i]);
}
for (it = c->begin(); it != c->end(); it++)
{
if (*it == 32) {
c->erase(it);
it = c->begin();
}
}
for (it = c->begin(); it != c->end(); it++)
{
cout << *it;
}
c->clear();
cout << "\n";
}
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题9.1 (C++代码)浏览:565 |
点我有惊喜!你懂得!浏览:3890 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)for循环浏览:1133 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1297 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:507 |
WU-输出九九乘法表 (C++代码)浏览:1672 |
WU-链表数据求和操作 (C++代码)浏览:1325 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:841 |
三角形 (C语言代码)浏览:920 |
K-进制数 (C语言描述,蓝桥杯)浏览:926 |