#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
void printV(vector<int> &v)
{
for (vector<int>::iterator it = v.begin(); it != v.end(); it++)
cout << *it <<" ";
cout << endl;
}
//accumulae: 对指定范围内的元素求和,然后结果再加上一个由val指定的初始值
void main55_accumulate()
{
vector<int> v1;
v1.push_back(1);
v1.push_back(3);
v1.push_back(5);
int tmp = accumulate(v1.begin(),v1.end(),100);
cout << tmp << endl;
}
//fill: 将输入值赋给标志范围内的所有元素
void main56_fill()
{
vector<int> v1;
v1.push_back(1);
v1.push_back(3);
v1.push_back(5);
fill(v1.begin(),v1.end(),8);
printV(v1);
}
int main()
{
//main52_copy();
//main53_replace();
//main53_replace_if();
//main54_swap();
//main55_accumulate();
main56_fill();
return 0;
}