逃避虽然可耻但有用

逃避虽然可耻但有用

少壮不努力,一生在内地

  • 主页
  • 归档
  • 关于
  • 消失

生成不重复的随机数

2013-03-15

文章目录
    • 下面代码就可以生成1-100区间的随机数:

下面代码就可以生成1-100区间的随机数:

#include <vector>
#include <algorithms>

std::vector<int> random_numbers;
for (unsigned int i = 0; i < 100; ++i)
    random_numbers.push_back(i + 1);
std::random_shuffle(random_numbers.begin(), random_numbers.end());
Programing
Algorithms Random_shuffle

上一篇

让ubuntu 12 desktop版本回归Gnome桌面

下一篇

VMware装Win7时网卡驱动问题处理

文章分类

  • 1 deploy
  • 1 interesting
  • 29 linux
  • 6 notices
  • 28 programing
  • 1 sites
  • 10 summarys
  • 2 works

文章标签

  • c3
  • centos5
  • compress2
  • conf2
  • css2
  • gcc2
  • git3
  • html2
  • https2
  • hugo2
  • install4
  • kernel3
  • layout2
  • libc2
  • linux12
  • ln2
  • make3
  • mud2
  • python3
  • safeseh2
  • style2
  • sudo2
  • ubuntu8
  • windows4
  • yum4
  • zlib4
RSS 订阅

Hello, this is leaker's blog in github.
Leaker: "Living without an aim is like sailing without a compass."

Powered by Hugo and Theme by Fika © 2022 leaker