# include <time.h>
# include <stdio.h>
# include <stdlib.h>
int main()
{
int i,j;
srand((int)time(0));
for(i=0;i<10;i++)
{
j=1+(int)(10.0*rand()/(RAND_MAX+1.0));
printf(" %d ",j);
}
system ("pause");
return 0;
}
摘自
百度知道
随机数
最新推荐文章于 2019-06-08 17:36:43 发布