美文网首页
18.fill算术生成算法

18.fill算术生成算法

作者: lxr_ | 来源:发表于2021-05-16 10:46 被阅读0次
#include<iostream>
using namespace std;

#include<vector>
#include<algorithm>
#include<numeric>

void PrintFunc(int val)
{
    cout << val << " ";
}
void test1801()
{
    vector<int> v;
    
    v.resize(10);

    fill(v.begin(), v.end(), 1);//后期重新填充容器

    for_each(v.begin(), v.end(), PrintFunc);
    cout << endl;
}
int main()
{
    test1801();

    system("pause");
    return 0;
}

相关文章

网友评论

      本文标题:18.fill算术生成算法

      本文链接:https://www.haomeiwen.com/subject/ojgirltx.html