
0

kotlin 生成指定范围的随机数
import java.util.Random
object Rand {
@JvmStatic fun main(args: Array<String>) {
print(randInt(1, 1000000000))
}
/**
* Returns a pseudo-random number between min and max, inclusive.
* The difference between min and max can be at most
* `Integer.MAX_VALUE - 1`.
* @param min Minimum value
* *
* @param max Maximum value. Must be greater than min.
* *
* @return Integer between min and max, inclusive.
* *
*/
fun randInt(min: Int, max: Int): Int {
// NOTE: Usually this should be a field rather than a method
// variable so that it is not re-seeded every call.
val rand = Random()
// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
val randomNum = rand.nextInt((max - min) + 1) + min
return randomNum
}
}
回复
Recommend
相关搜索关键词
Recent search keywords
- Rescission
- ShadowsocksR
- 仙仙桃
- employ
- note 11
- Cloud Native Go: Building Reliable Services in Unreliable Environments
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php") and 1518=1518-- nicv
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php)) and 1959=4519-- xlnb
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php)) and 1518=1518-- jypj
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" and 1518=1518-- cful
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php and 8149=7509
- -8372 or 3862=3895
- -9681 or 9413=9413-- wxwt
- -1543" or 3754=2892-- tgvz
- -1904") or 8791=1943-- ibne
- gift card for a review
- -7603") or 3409=1067-- kxki
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php and 1288=1288
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php and 1288=1288-- uhlu
- -9711) or 8647=8647-- fwqo
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" and 1288=1288 and "hqiv"="hqiv
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" and 8361=5812-- aufj
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php and 5166=2264-- afzp
- -1139)) or 8647=8647-- hijb
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php") and 8680=7802-- czkx
- -1506" or 8647=8647-- hyrh
- -5077" or 9413=9413 and "pwss"="pwss
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" and 3712=5405 and "zmlf"="zmlf
- -1317)) or 1551=8546-- ztsd
- -6412 or 9413=9413
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php and 4040=9651-- eomj
- -7885" or 1736=1265 and "pbzn"="pbzn
- -8701) or 6896=1483-- wopk
- -6756" or 3771=2193 and "yjrl"="yjrl
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php) and 1518=1518-- zwrb
- -4779)) or 6681=6772-- xlmh
- -1558" or 4889=3052-- vsho
- -6759") or 8647=8647-- bsyo
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php) and 7607=9694-- tsen
- -4445) or 5551=9954-- cqfd
- -3808 or 6446=6128-- njrj
- mediawiki
- rookmotion
- Gift Card for a Review
- 10.1 2014
- asyrafhussin
- blogsandarticlesshop
- webdailyblogging
- -1558" OR 4889=3052-- vShO
- -1506" OR 8647=8647-- hYRH
- -1543" OR 3754=2892-- tGvZ
- -1904") OR 8791=1943-- IbNE
- -6759") OR 8647=8647-- BSYO
- -7603") OR 3409=1067-- KxKi
- -1317)) OR 1551=8546-- ZTSd
- -1139)) OR 8647=8647-- HIJb
- -4779)) OR 6681=6772-- xLmH
- -8701) OR 6896=1483-- woPK
- -9711) OR 8647=8647-- FWQO
- -4445) OR 5551=9954-- CQfD
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" AND 1518=1518-- cfUl
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" AND 8361=5812-- Aufj
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php") AND 1518=1518-- nICv
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php") AND 8680=7802-- czKx
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php)) AND 1518=1518-- jyPj
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php)) AND 1959=4519-- Xlnb
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php) AND 1518=1518-- ZWRb
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php) AND 7607=9694-- tseN
- -9681 OR 9413=9413-- WxWt
- -3808 OR 6446=6128-- NJRj
- -6756" OR 3771=2193 AND "yjrL"="yjrL
- -5077" OR 9413=9413 AND "PWss"="PWss
- -7885" OR 1736=1265 AND "pBzn"="pBzn
- -6412 OR 9413=9413
- -8372 OR 3862=3895
- -5843
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php AND 4040=9651-- eomJ
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php AND 1288=1288-- uHLu
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php AND 5166=2264-- AfzP
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" AND 1288=1288 AND "HQIV"="HQIV
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php" AND 3712=5405 AND "zMlf"="zMlf
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php AND 1288=1288
- zip/vendor/phpunit/phpunit/src/util/php/eval-stdin.php AND 8149=7509
- 6040
- github - glixzzy/blooket-hack: multiple hacks that breaks the game)) and 2654=2654-- krik
- -7069 or 3290=4340
- github - glixzzy/blooket-hack: multiple hacks that breaks the game)) and 2942=2586-- hmkc
- github - glixzzy/blooket-hack: multiple hacks that breaks the game)) and 9743=5971-- azxy
- -9297") or 5699=8510-- fpar
- -2570" or 7095=8951 and "lvjs"="lvjs
- github - glixzzy/blooket-hack: multiple hacks that breaks the game" and 2346=3357-- lwyp
- github - glixzzy/blooket-hack: multiple hacks that breaks the game") and 2654=2654-- swzd
- -1994" or 6585=6585-- ailj
- -3849" or 9144=3514-- odii
- -2890") or 6585=6585-- nwkq
- github - glixzzy/blooket-hack: multiple hacks that breaks the game) and 7431=7060-- pumz
- github - glixzzy/blooket-hack: multiple hacks that breaks the game and 9927=8076-- mzog
- github - glixzzy/blooket-hack: multiple hacks that breaks the game and 1958=7937
- -5588) or 4994=8765-- nlzq
- github - glixzzy/blooket-hack: multiple hacks that breaks the game and 9347=9347