文件名称:vectoralist
-
所属分类:
- 标签属性:
- 上传时间:2012-10-20
-
文件大小:1.06kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
练习vector和list的使用
定义一个空的vector,元素类型int,生成10个随机数插入到vector中,用迭代器遍历vector并输出其中的元素值。在vector头部插入一个随机数,用迭代器遍历vector并输出其中的元素值。用泛型算法find查找某个随机数,如果找到便输出,否则将此数插入vector尾部。用泛型算法sort将vector排序,用迭代器遍历vector并输出其中的元素值。将vector清空。
定义一个list,并重复上述实验,并注意观察结果。
-Exercises vector and list defines the use of an empty vector, element type int, generate 10 random numbers inserted into the vector, iterate over the vector and the output element values. Vector iterator to traverse, and output the value of one of the elements in the vector head insert a random number. Find generic algorithms to find a random number, and if found will output, otherwise this number inserted into the vector tail. Using generic algorithms sort the vector Sort iterator traversal vector and output the value of one of the elements. The vector emptied. Define a list, and repeat the experiment, and observe the results.
定义一个空的vector,元素类型int,生成10个随机数插入到vector中,用迭代器遍历vector并输出其中的元素值。在vector头部插入一个随机数,用迭代器遍历vector并输出其中的元素值。用泛型算法find查找某个随机数,如果找到便输出,否则将此数插入vector尾部。用泛型算法sort将vector排序,用迭代器遍历vector并输出其中的元素值。将vector清空。
定义一个list,并重复上述实验,并注意观察结果。
-Exercises vector and list defines the use of an empty vector, element type int, generate 10 random numbers inserted into the vector, iterate over the vector and the output element values. Vector iterator to traverse, and output the value of one of the elements in the vector head insert a random number. Find generic algorithms to find a random number, and if found will output, otherwise this number inserted into the vector tail. Using generic algorithms sort the vector Sort iterator traversal vector and output the value of one of the elements. The vector emptied. Define a list, and repeat the experiment, and observe the results.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
vector&list.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.