[求助]怎么随机数不变
各位高手:
请大家帮帮小弟一把,怎么每次运行时,取的随机数序列都一样!不知如何改是好!
在下有礼了!
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void main()
{
int i;
srand( system("time"));
for(i=0;i<10;i++)
printf( "%6d\n",rand());
}
hyqzchh@163.com
各位高手:
请大家帮帮小弟一把,怎么每次运行时,取的随机数序列都一样!不知如何改是好!
在下有礼了!
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void main()
{
int i;
srand( system("time"));
for(i=0;i<10;i++)
printf( "%6d\n",rand());
}
hyqzchh@163.com