如何p使用C标准库rand()函数生成概率为(其中0 <= p <= 1.0)的随机布尔值?
p
rand()
即
bool nextBool(double probability) { return ... }
c random
c ×1
random ×1