アルゴリズムのテスト

アルゴリズムのテスト

書式#include <アルゴリズム> 
書式#include <ベクトル> 
の#include <iostreamの>

使用して  名前空間はstdを、

int型のmain()
{
    ベクター < INT > vec_1 = { 3762189 }。

    自動MinPos = min_element(vec_1.cbegin()、vec_1.cend())。
    ベクター < INT > ::イテレータvec_min_iter = min_element(vec_1.begin()、vec_1.end())。
    裁判所未満 << " 最小値:   " << * minpos << "    " << * vec_min_iter << てendl;

    車MAXPOS = max_element(vec_1.cbegin()、vec_1.cend())。
    ベクター < INT > ::イテレータvec_max_iter = max_element(vec_1.begin()、vec_1.end())。
    裁判所未満 << " 最大値:   " << * maxpos << "    " << * vec_max_iter << てendl;



    システム(一時停止)。
    リターン 0 ;
}

値min :. 1. 1
最大値:. 9. 9
続けるには任意のキーを押します。

おすすめ

転載: www.cnblogs.com/herd/p/12024689.html