Function GetRandomMath(m,n)
Randomize
GetRandomMath = Int(((n-m+1) * Rnd) + m)
End Function
msgbox"我可以为你生成随机数",1
If intAnswer = vbYes Then
dim a,b
a=inputbox"起始值"
b=inputbox"结束值"
msgbox GetRandomMath(a,b)
else msgbox"再见"
Wscript.Quit
end if
end
文件保存为ascii编码的
Function GetRandomMath(m,n)
Randomize
GetRandomMath = Int(((n-m+1) * Rnd) + m)
End Function
intAnswer=msgbox("我可以为你生成随机数",vbYesNo)
If intAnswer = vbYes Then
dim a,b
a = InputBox("起始值")
b = InputBox("结束值")
msgbox GetRandomMath(a,b)
else
msgbox "再见"
Wscript.Quit
end if