#include <stdio.h>
#include <stdlib.h>
#include<time.h>
int main(void)
{
srand((unsigned)time(0));
for (int i=0;i<10;i++)
printf("%d ",rand());
getchar();
return 0;
#include <stdlib.h>
#include<time.h>
int main(void)
{
srand((unsigned)time(0));
for (int i=0;i<10;i++)
printf("%d ",rand());
getchar();
return 0;
}
这个是真随机数
还有假随机数
srand((unsigned)time(0)); //这条语句不要就是假随机数了