解题思路:
注意事项:
参考代码:
#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 人评分
1128题解(返回值为数组的情况)浏览:486 |
数组输出 (C语言代码)浏览:717 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:453 |
分解质因数 (C++代码)浏览:1500 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:589 |
C语言训练-排序问题<1> (C语言代码)浏览:356 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:397 |
C语言训练-求PI* (C语言代码)浏览:513 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:545 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:516 |