您的位置首页百科知识

VB,关于随机数

VB,关于随机数

的有关信息介绍如下:

VB,关于随机数

要互不相同的话,直接用rnd赋值巧饥纯是不够的Private Sub Command1_Click()Randomizetemp = "12345"孝咐n = Len(temp)i = Int(n * Rnd) + 1a = Val(Mid(temp, i, 1))temp = Replace(temp, a, "")n = Len(temp)i = Int(n * Rnd) + 1b = Val(Mid(temp, i, 1))temp = Replace(temp, b, "")n = Len(temp)i = Int(n * Rnd) + 1c = Val(Mid(temp, i, 1))temp = Replace(temp, c, "肢哪")n = Len(temp)i = Int(n * Rnd) + 1d = Val(Mid(temp, i, 1))temp = Replace(temp, d, "")e = Val(temp)Print a, b, c, d, eEnd Sub