#include <string.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

void main()
{
string m("----------asdfas--------------dfgdf---------");
string::iterator it;
vector<char> csr;
vector<char>::iterator cit;
for (it=m.begin();it!=m.end();it++)
csr.push_back(*it);

cit=remove(csr.begin(),csr.end(),'-');
csr.erase(cit,csr.end());

copy(csr.begin(),csr.end(),ostream_iterator<char>(cout,""));
cout<<endl;
}

相关文章:

  • 2021-06-16
  • 2021-11-07
  • 2021-10-26
  • 2021-12-29
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案