64,666
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> a;
a.push_back(1);
a.push_back(6);
a.push_back(6);
a.push_back(3);
vector<int>::iterator now;
now = remove(a.begin(),a.end(),6);
for (vector<int>::const_iterator i = a.begin();i != now; ++i)
{
cout<<*i<<endl;
}
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> a;
a.push_back(1);
a.push_back(6);
a.push_back(6);
a.push_back(3);
vector<int>::iterator now;
now = remove(a.begin(), a.end(), 6);
for (int i = 0;i<a.size();i++)
{
cout<<a[i]<<endl;
}
}