用std::fill_n把一个int序列填充为0
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main(int argc, char* argv[])
{
vector<int> v {1, 2, 3, 4, 5};
std::fill_n(v.begin(), v.size(), 0);
for (auto value : v)
{
cout << value << endl;
}
}