#rand1

rand7生成rand10,rand1生成rand6,rand2生成rand5(包含了rand2生成rand3)

这种题要分两步,第一步是“插空儿”,第二步是“筛”1.rand7生成rand10只要是10的倍数就好intrand10(){intnum;do{num=(rand7()-1)*7+rand7()-1;}while(num>=40);returnnum%10+1;}概率计算:https://blog.csdn.ne...