生成随机整数

原文链接: http://www.cnblogs.com/cross-yan/p/6285395.html
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
int main()
{
	int a[10];
	srand((unsigned)time(NULL));
	for (int i=0; i<10; i++)
	{	a[i]=rand()%10;
		printf("%d  ",a[i]);
	}
} 

博客来源:http://blog.sina.com.cn/s/blog_574f9aa00100rkis.html

转载于:https://www.cnblogs.com/cross-yan/p/6285395.html

猜你喜欢

转载自blog.csdn.net/weixin_30687051/article/details/94802803
今日推荐