#include <stdio.h>
#include <stdlib.h>
int rnd(void);
void seedrnd(void);
int main()
{
int x;
seedrnd();
puts("Behold! 20 Random Numbers!");
for(x=0;x<0;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)
{
int seed;
char s[6];
printf("Enter a random number seed (2 - 65000):");
seed=(unsigned)atoi(gets_s(s));
srand(seed);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266760.html