Home > Back-end >  The random number is not random?
The random number is not random?

Time:09-19

C language use srand (time (NULL)) to after sowing the rand function to generate random Numbers in a row to generate a random number when it close, how to solve your bosses

CodePudding user response:

#include
#include


using namespace std;


# include

# include
# include
using namespace std;
Int main ()
{

Srand ((unsigned) time (NULL));
for(int i=1; i<=10; + + I)
{

Int n=rand ();
Cout}
return 0;
}

CodePudding user response:

What's close? Srand rand after use can also ah

CodePudding user response:

Post code, no truth
  • Related