stl练习
CKJiang
未来不迎,过往不念,当下不杂
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
stl vector实现随机重排列
#include #include #include #include using namespace std;void Swap(int &a, int &b){ int c = a; a = b; b = c;}void random_arrange(int a[], int len){ int i; srand(原创 2013-10-14 22:46:49 · 5263 阅读 · 0 评论 -
随机生成num个数,用set
/** *随机生成num个数 * */#include #include #include using namespace std;void getallnum(int *a, int MIN, int MAX, int num){ int i; set m; set::iterator it; srand(time(NULL)); //如果种子(即原创 2013-10-14 21:24:54 · 1192 阅读 · 0 评论
分享