![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vector
文章平均质量分 71
老鼠哎大米
这个作者很懒,什么都没留下…
展开
-
STL容器之vector
Vecto vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库。vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,能够增加和压缩数据。为了可以使用vector,必须在你的头文件中包含下面的代码:#include 构造函数。 Vector转载 2017-02-20 10:44:56 · 239 阅读 · 0 评论 -
九度OJ Graduate Admission
It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission原创 2017-03-02 15:15:06 · 237 阅读 · 0 评论 -
设计捕获两种不同类型的异常,一个是被0 除,另一个是数组越界。
设计捕获两种不同类型的异常,一个是被0 除,另一个是数组越界。 #include #include using namespace std; class A{ }; class B{ }; main() { int a,b,length; vector arr; cout<<"请输入除数和被除数:"<<endl; cin>>a>>b; try{ if(b==0)原创 2017-02-23 21:58:20 · 1432 阅读 · 0 评论 -
排序
输入一串整数,输入命令排序。 输入a t 在这串整数后面添加整数 t 输入c \m \n 用n替换m 输入d t 删除t 输入s 排序 #include #include //#include #include using namespace std; void display(vector v) { cout<<"当前数据为:"<<endl; vecto原创 2017-02-20 11:02:07 · 183 阅读 · 0 评论 -
分组统计
先输入一组数,然后输入其分组,按照分组统计出现的次数并输出。如: 输入数据:3 2 3 8 8 2 3 0 输入分组:1 2 3 2 1 3 1 0 输出: 1={2=0 3=2 8=1} 2={2=1 3=0 8=1} 3={2=1 3=1 8=0} #include #include #include using namespace std; void display(map m) { map:原创 2017-02-20 11:23:19 · 655 阅读 · 0 评论