首页 > 其他分享 >111

111

时间:2023-12-31 10:14:10浏览次数:23  
标签:begin cout int 111 b2 sizeof

#include <bits/stdc++.h>
using namespace std;
int main(){
    list<int> a;
    int b[] = {1,2,3,4};
    list<int> c(b,b+sizeof(b)/sizeof(int));
    a.insert(a.begin(),c.begin(),c.end());
    a.insert(a.begin(),3,1);
    //在容器首位添加元素 
    a.push_front(0);
    //在容器末位添加元素 
    a.push_back(5);
    cout<<"一:"<<a.front()<<endl;
    cout<<"末:"<<a.back()<<endl;
    //删除首位元素
    a.pop_front();
    a.sort();
    a.unique();
    cout<<"c:"<<c.size()<<endl;
    a.splice(a.begin(),c);
    cout<<"c:"<<c.size()<<endl;
    a.sort(); 
    int b2[] = {7,8,9,10};
    list<int> c2(b2,b2+sizeof(b2)/sizeof(int));
    cout<<"c2:"<<c2.size()<<endl;
    a.merge(c2);
    cout<<"c2:"<<c2.size()<<endl;
    a.reverse();
    for(list<int>::iterator i = a.begin();i!=a.end();i++){
        cout<<*i<<" ";
    }
    return 0;
}

 

标签:begin,cout,int,111,b2,sizeof
From: https://www.cnblogs.com/wangyihang-xh/p/17937233

相关文章

  • 111
    #include<iostream>#include<list>#include<algorithm>usingnamespacestd;intmain(){ list<int>a; intb[]={1,2,3,4}; list<int>c(b,b+sizeof(b)/sizeof(int)); a.insert(a.begin(),c.begin(),c.end()); a.insert(a.begin(),......
  • 111
    #include<iostream>usingnamespacestd;voidMAIN();intmain(){intn;while(1){MAIN();cin>>n;inttime;switch(n){case1:{cout<<"请输入等待关机时间:";......
  • 11111111
    #include<iostream>#include<vector>#include<windows.h>usingnamespacestd;inta=999;intb=0;boolc=false;structstudent{ stringname; intage; intcard; intgrade;}s;voidka(){ cout<<"学生管理系统:"<<endl; c......
  • 代码随想录算法训练营第十六天 |104.二叉树的最大深度,559.n叉树的最大深度,111.二叉树
    一、104.二叉树的最大深度题目链接:LeetCode104.二叉树的最大深度学习:思路:分别求左子树和右子树的高度,返回给根结点,加1之后是根结点的深度,这是后序遍历的思路二、559.n叉树的最大深度题目链接:LeetCode559.N叉树的最大深度学习前:思路:后序遍历。分别所有孩子结点的深......
  • [LeetCode Hot 100] LeetCode111. 二叉树的最小深度
    题目描述思路二叉树的最小深度就是第一个叶子节点所在的层数方法一:前序遍历(递归、dfs)/***Definitionforabinarytreenode.*publicclassTreeNode{*intval;*TreeNodeleft;*TreeNoderight;*TreeNode(){}*TreeNode(intva......
  • ORA-01113: file 69 needs media recovery ORA-01110: data file 69: 'E:\FWPTDB\D
    继续上一篇写1、当解决了ORA-01033:ORACLEinitializationorshutdowninprogress 这个问题后重新连接此数据库的时候又出现以下问题ORA-01113:file69needsmediarecovery ORA-01110:datafile69:'E:\FWPTDB\DBFFILES\HNRZ\HNRZFW.DBF2、解决方案  ......
  • 鸿蒙、ChatGPT 入选全球十大工程成就丨 RTE 开发者日报 Vol.111
       开发者朋友们大家好: 这里是「RTE开发者日报」,每天和大家一起看新闻、聊八卦。我们的社区编辑团队会整理分享RTE(RealTimeEngagement)领域内「有话题的新闻」、「有态度的观点」、「有意思的数据」、「有思考的文章」、「有看点的会议」,但内容仅代表......
  • let a={name:'111',age:222} 如果b是空对象,a中的属性都是空,如果b中的属性是空,a中的属
    leta={name:'111',age:222};letb={};//Iterateoverthepropertiesofafor(letpropina){if(a.hasOwnProperty(prop)){//Assignanemptystringtothepropertyinaa[prop]='';}}console.log(a);{name......
  • 111
    /home/sdnu/anaconda3/envs/DDIM/bin/python/media/sdnu/f9cc3556-f530-42b2-95df-64c823288321/home/sdnu/SXY/Diffusion/latent-dehazing/train.pyexportCUDA_VISIBLE_DEVICES=0Disableddistributedtraining.Pathalreadyexists.Renameitto[/media/sdnu/f9cc3556-f......
  • 兰馨五棵松20211110个人贡献
    我完成的工作:主要负责前端设计,参与了部分数据库整合和文本编写。我们小组的相关代码链接:https://gitee.com/an-jiran/dzgwxt/tree/master/(撰写代码时未统计代码行数)我们小组总共发布14篇博客,我贡献了其中5篇,相关链接如下:https://www.cnblogs.com/lanxin5kesong/p/17780874.ht......