multiset-begin

////////////////////////////////////////
//      2018/04/29 17:00:21
//      multiset-begin

// returns an iterator to the first element
#include <iostream>
#include <set>
#include <algorithm>
#include <iterator>

using namespace std;

int main(){
    int ary[] = { 1, 2, 3, 2, 4, 5, 7, 2, 6, 8 };
    multiset<int> s(ary, ary + 10);

    copy(s.begin(), s.end(), ostream_iterator<int>(cout, " "));
    cout << endl;
    return 0;
}


/*
OUTPUT:
  1 2 2 2 3 4 5 6 7 8
*/ 
posted @ 2018-04-30 08:26  老耗子  阅读(39)  评论(0编辑  收藏  举报