在Math类中random方法可以产生随机数。如果从1到100之间产生一个随机整数(大于等于1,小于等于100),并赋值给n,那么下面语句正确的是()。
第1题:
执行int x=(int)(Math.random()*100);语句时,不会出现下列哪个数值?
A.1
B.35
C.48
D.100
第2题:
A.random()
B.abs()
C.sin()
D.pow()
第3题:
A.Math.round()
B.Math.random()
C.Math.ceil()
D.Math.floor()
第4题:
动作语句:math.random()*10表示产生0--10之间的随机数。
A对
B错
第5题:
A.Math.ceil(512.51)返回的结果为512
B.Math.floor( )方法用于对数进行下舍入
C.Math.round(-512.51)返回的结果为-512
D.Math.random( )返回结果为0~1,包括0和1
第6题:
A.round
B.random
C.pow
D.sqrt
第7题:
A.Math.ceil(512.51)返回的结果为512
B.Math.floor( )方法用于对数字进行下舍入
C.Math.round(-512.51)返回的结果为-512
D.Math.random( )返回的结果范围为0-1,包括0和1
第8题:
此题为判断题(对,错)。
第9题:
A.(int)(20+Math.random()*979)
B. 20+(int)(Math.random()*980)
C. (int)Math.random()*999
D. 20+(int)Math.random()*980
第10题:
Javascript里Math的()方法返回介于0和1之间的伪随机数。