随机生成数

看代码吧︿( ̄︶ ̄)︿

#include<iostream>
#include<cstdio>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cstdlib>

using namespace std;

int main()
{
	srand(time(0));
	for(int i=1;i<=1000;i++)
	cout<<rand()%100+1<<" ";
//(b-a+1)+a
//表示a~b之间的一个随机整数 
	return 0;
}

  

看一下就知道啦!~(≧▽≦)/~啦啦啦

还有一个很好的blog链接啦

关于rand()和srand()函数

“为什么圆规能画出圆?” “因为心不变,脚在动。”
原文地址:https://www.cnblogs.com/xrj1229/p/9238692.html