?? copy.cpp
字號:
// copy.cpp : 定義控制臺應(yīng)用程序的入口點(diǎn)。
// [2009/4/29/19:09 wxf]
//////////////////////////////////////////////////////////////////////////
// 容器間拷貝元素函數(shù)。
//////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <algorithm>
#include <vector>
#include <list>
#include <iostream>
using namespace std;
void print(int x)
{
cout<<x<<" ";
}
int _tmain(int argc, _TCHAR* argv[])
{
vector<int> v;
v.push_back(1);
v.push_back(3);
v.push_back(5);
list<int> l;
l.push_back(2);
l.push_back(4);
l.push_back(6);
l.push_back(8);
l.push_back(10);
copy(v.begin(),v.end(),l.begin());
for_each(l.begin(),l.end(),print);
cout<<endl;
system("pause");
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -