问题
单项选择题
下列程和序段的执行结果为( )。 x=Int(Rnd()+9) Select Case X Case 10 Print "excellent" Case 9 Print "good" Case 8 Print "pass" Case Else Print "fail" End Select
A. excellent
B. good
C. pass
D. fail
答案
参考答案:B
解析:x=Int(Rnd()+9)语句中,Rnd是用来产生随机数的,其值在0~1之 间,而在(Rnd()+9)前面有Int进行强制转换,所以x总为9,Select Case x……End Select 语句体中的Case 9<CR>Print " good "语句。