WTF?????
还有这种操作???
不得不说,C++大法好!!!
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void Showout(int a)
{
cout << a << endl;
}
void test01()
{
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
v.push_back(60);
//第一种遍历
/*vector<int>::iterator ItBegin = v.begin();
vector<int>::iterator ItEnd = v.end();
while (ItBegin != ItEnd)
{
cout << *ItBegin << endl;
ItBegin++;
}*/
//第二种遍历
/*for (vector<int>::iterator i = v.begin(); i < v.end(); i++)
{
cout << *i << endl;
}*/
//第三种遍历
/*for_each(v.begin(), v.end(), Showout);*/
}
int main()
{
test01();
return 0;
}