c++如何生成随机数
编译环境vs2013
#include<iostream>
#include<time.h>
using namespace std;
int main()
{
int num = 0;
srand(time(NULL)); //系统时间作为随机种子
num = rand(); //rand()函数产生随机数
cout << "生成的随机数为" << num << endl;
system("pause");
return 0;
}