重学C++ 标准库算法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/artisans/article/details/81260564

求最大值

    vector<int> vv { 11,223, 22 };

    auto itor = std::max_element(vv.begin(), vv.end());
    if (itor != vv.end())
    {
        cout << "max " << *itor << endl;
    }
    int z = std::max({ 11,223, 22 });

猜你喜欢

转载自blog.csdn.net/artisans/article/details/81260564