自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 runtime error

runtime error数组越界 :数组开大点主函数中栈堆积 改:数组定义是局部变量指针越界除数是0

2019-08-29 10:25:15 681

原创 求最大值最小值 max_element min_element

#include <bits/stdc++.h>#include <iostream>#include <string.h>using namespace std;int main(){ int a[]={0,1,2,3}; int l=*max_element(a,a+4);//min_elementprintf("%d...

2019-08-27 10:23:31 226

原创 unique函数

unique“去除”相同的元素————实际上只是把相同的元素移在了后面,没有删除#include <stdio.h>#include <iostream>#include <algorithm>using namespace std;int main(){ int a[5]={0,4,3,5,3}; sort(a,a+5);//因...

2019-08-27 10:22:11 118

原创 优先队列

优先队列push() 进pop() 出top() 顶empty() 为0非空size() 大小priority_queue< int,vector<int>,greater<int> > q;//递增排序priority_queue<int ,deque<int>,greater<int> >q;//递增排...

2019-08-20 11:44:52 83

原创 c++ stack 栈

栈头文件写:#include<stack>定义: stack <类型> 栈的名称;push()进栈pop()出栈顶size()栈的大小...栈的元素个数empty()判空...1为空,0为非空代码如下#include <bits/stdc++.h>#include <stack>using namespace std...

2019-08-20 10:38:13 146

原创 c++ queue

队列头文件 #include <queue>定义 queue<类型> 队列名称push() 入队pop() 出队front() 头元素大小back() 为元素大小size() 元素个数,队列大小empty() 1为空,0非空#include <bits/stdc++.h>#include <queue>usin...

2019-08-20 10:34:41 81

原创 multiset(与set有点点不同)

 multiset与set的不同之处就是key可以重复,以及erase(key)的时候会删除multiset里面所有的key并且返回删除的个数。代码如下#include <stdio.h>#include <set>#include <iostream>using namespace std;int main(){ multise...

2019-08-19 13:55:58 105

原创 set (1)

set迭代器采用中序遍历,检索效率高于vector,默认从小到大自动排序;set容器中的数值,一经更改,set会根据新值旋转二叉树,以保证平衡;时间复杂度logn;insert输入;指针指向输出;代码如下#include <stdio.h>#include <set>#include <iostream>using namespace std;...

2019-08-19 13:46:27 544

原创 string 的 length(),size(),empty(),begin( ) , end( ) , clear( ) , erase( );

string 的 length(),size(),empty(),begin( ) , end( ) , clear( ) , erase( );代码如下#include <stdio.h>#include <string.h>#include <iostream>using namespace std;int main(){ string...

2019-08-19 10:25:58 199

原创 vector

vector的插入及基本要素#include <stdio.h>#include <iostream>//cin>> cout<< 必备#include <vector>//vector 必备using namespace std;int main(){ int a[1000]; vector...

2019-08-18 23:10:38 2422

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除