📄 fill.cpp
字号:
// fill.cpp : 定义控制台应用程序的入口点。
// [2009/5/1/13:30 wxf]
//////////////////////////////////////////////////////////////////////////
// 将同一个值填充到容器的一个或多个元素处。
//////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void print(int a)
{
cout<<a<<" ";
}
int _tmain(int argc, _TCHAR* argv[])
{
vector<int> v(5);
fill(v.begin(),v.end(),30);
for_each(v.begin(),v.end(),print);
cout<<endl;
system("pause");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -