首页 > 其他分享 >111

111

时间:2023-12-31 10:13:52浏览次数:22  
标签:begin cout int 111 sizeof include

#include <iostream>
#include <list>
#include <algorithm>
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进行排序,从大到小排序
	a.sort();
	//一处重复元素
	a.unique();
	cout<<"转移之前,c大小="<<c.size()<<endl;
	//将c转移给a之前
	a.splice(a.begin(),c);
	cout<<"转移之后,c大小="<<c.size()<<endl;
	//将所有元素反许 
	a.reverse();
	//注意i的类型 带起
	for(list<int>::iterator i=a.begin();i!=a.end();++i){
		cout<<*i<<" ";
	} 
	return 0;
}

  

标签:begin,cout,int,111,sizeof,include
From: https://www.cnblogs.com/boyeyuan/p/17937232

相关文章

  • 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......
  • 20211101王晨博电子公文网站个人贡献
    个人贡献1.活动图2.前端网页,页面显示优化3.适配新增加解密功能、完善前端页面及接口调试4.前端页面5.代码个人贡献878行,小组共4800+行https://gitee.com/kcf03/man-k/tree/0d9851e308a40770bd47ef9f0c2847d586c9ff59/front6.小组文档15篇,我贡献1篇https://www.cnblogs......