Random in C language is not a real random number, which is also called pseudo-random number. Because the rand () function generates integers in the specified order, the same value will be printed every time the above statement is executed. In order to generate a new sequence of random values every time a program executes, we usually provide a new random seed for the random number generator, and the function srand () (from stdlib.h) can sow the seed for the random number generator. The rand () function will generate different random number sequences, as long as the seeds are different.
1L positive solution, plus srand (time (space)); That's it.