#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int i,j;
srand( (unsigned)time(NULL));
/*生成10个随机数*/
for (i=0;i<10;i++)
{
//生成实际随机数
j=rand();
cout << "随机数: "<<j <<endl;
}
return 0;
}
随机数: 1563984234 随机数: 1493872638 随机数: 742794530 随机数: 846192927 随机数: 601279458 随机数: 113844087 随机数: 839863344 随机数: 1536651017 随机数: 575020234 随机数: 373566792
来源:https://www.cnblogs.com/luoganttcc/p/10525171.html