#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int rnd(int range);
void seedrnd(void);
int main()
{
int x;
seedrnd();
for(x=0;x<20;x++)
printf("%i/t",rnd(10));
printf("/n--------------------------/n");
return(0);
}
int rnd(int range)
{
int r;
r=rand()%range;
return(r);
}
void seedrnd(void)
{
srand((unsigned)time(NULL));
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266758.html