#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int rnd(void);
void seedrnd(void);
int main()
{
int x;
seedrnd();
puts("Behold! 100 Random Numbers!");
for(x=0;x<20;x++)
printf("%d/t",rnd());
printf("/n=============================/n");
return(0);
}
int rnd(void)
{
int r;
r=rand();
return(r);
}
/* seed the random number */
void seedrnd(void)
{
srand((unsigned)time(NULL));
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/266759.html