rand

#include <stdio.h>
#include <stdlib.h>

int main()
{
 srand(100);  //设置种子,种子一样,每次启动程序时生成的数也一样
 int i;
 int num;
 for(i=0; i<10; i++)
 {
  num = rand();
  printf("%d\t", num);
 }
 return 0;
}

猜你喜欢

转载自www.cnblogs.com/xumaomao/p/11980302.html
今日推荐