码迷,mamicode.com
首页 > 其他好文 > 详细

set容器

时间:2020-03-12 14:22:24      阅读:38      评论:0      收藏:0      [点我收藏+]

标签:cout   name   code   insert   using   ace   mes   int   begin   

set正向便利

#include<bits/stdc++.h>
#include<set>
using namespace std;

int main()
{
    set<int> te;
    
    te.insert(1);
    te.insert(2);
    te.insert(3);
    
    
    set<int>:: reverse_iterator  it;
    for(it=te.rbegin() ;it!=te.rend();it++)
    {
        cout<<*it;
        
    }
 } 

set反向遍历

set<int>:: reverse_iterator  it;
    for(it=te.rbegin() ;it!=te.rend();it++)
    {
        cout<<*it;
        
    }

set容器

标签:cout   name   code   insert   using   ace   mes   int   begin   

原文地址:https://www.cnblogs.com/shenxiaodou/p/12468742.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!