现在的位置: 首页 > 综合 > 正文

随机函数Randomize

2013年08月16日 ⁄ 综合 ⁄ 共 433字 ⁄ 字号 评论关闭
Technorati 标签: ,,

The Randomize statement initializes the random number generator. The instruction Int((maxNum – minNum + 1) * Rnd + minNum) uses the Rnd function to generate a random value from the specified minNum to maxNum. The Int function converts the resulting random number to an integer. Instead of assigning constant values for minNum and maxNum, you can use the InputBox function to get these values from the user.

  1. Randomize 
  2. lucky(t) = Int((maxNum - minNum + 1) * Rnd + minNum) 

抱歉!评论已关闭.