2019-08-02

随机数的产生

产生随机数的代码:

#include "time.h"
srand((unsigned int)time(NULL));
rand()  %  10;   //对10取余得到0到9的随机数。

你可能感兴趣的:(2019-08-02)