rand()产生随机数进行测试

#include<cstdio>
#include<cstdlib>
#include<ctime>
using namespace std;
const int maxn=10010;
const int N=10;

int main(){

	srand(time(NULL));//srand(1)  seedrand() 

	int n=6;
	
	while(n--) printf("%lld\n",rand()%10);
	
//	printf("%lld\n",time(NULL)); 
		
//	cout<<time(NULL);
		
	return 0;
}
发布了138 篇原创文章 · 获赞 18 · 访问量 7060

猜你喜欢

转载自blog.csdn.net/qq_924485343/article/details/104242428