用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;
}
}
标签:std,10.6,int,练习,include,fill
From: https://www.cnblogs.com/yuzuki/p/17564371.html