在 VBScript 中是否可以选择将两个整数并排放置?
Is there an option to put two integers next to each other in VBScript?
我正在尝试将两个整数并排放置,但经过一些尝试后,我到达了这里,但无法继续前进。你能帮帮我吗?
Dim max, min
max = 9
min = 0
Randomize
n1 = (Int((max-min+1)*Rnd+min))
max = 9
min = 0
Randomize
n2 = (Int((max-min+1)*Rnd+min))
x = MsgBox(n1, 1, "numbers")
x = MsgBox(n2, 1, "numbers")
numb = n1 + n2
x = MsgBox(numb, 1, "numbers")
我希望这两个随机生成的数字彼此相邻。
GSerg 带来答案:
行:
numb = n1 + n2
应改为:
numb = n1 & n2
希望对您有所帮助!
我正在尝试将两个整数并排放置,但经过一些尝试后,我到达了这里,但无法继续前进。你能帮帮我吗?
Dim max, min
max = 9
min = 0
Randomize
n1 = (Int((max-min+1)*Rnd+min))
max = 9
min = 0
Randomize
n2 = (Int((max-min+1)*Rnd+min))
x = MsgBox(n1, 1, "numbers")
x = MsgBox(n2, 1, "numbers")
numb = n1 + n2
x = MsgBox(numb, 1, "numbers")
我希望这两个随机生成的数字彼此相邻。
GSerg 带来答案:
行:
numb = n1 + n2
应改为:
numb = n1 & n2
希望对您有所帮助!