试题 试卷
题型:单选题 题类:常考题 难易度:容易
面向对象程序设计习题
Dim a(0 To 9) As Integer, t as Long
t=Val(Text1.Text)
Do While t<>0
a(t Mod 10) = 1
t = t \ 10
Loop
For i = 0 To 9
x = x + a(i)
Next i
Text1中输入10242048,则程序执行后x的值为( )
Dim a(1 To 5) As Integer
a(1) = 1
For i = 2 To 5
a(i) = Int(Rnd * 5) + 1
If a(i) Mod 2 = 0 Then
a(i) = a(i) + i
Else
a(i) = a(i) + a(i - 1)
End If
a(1)~a(5)的值不可能的是( )
k=1; lmax=1; n=len(d)
for I in range(1, n):
if d[i]>d[i-1]:
k+=1
else:
if k>lmax:
lmax=k
k=1
print(lmax)
该程序段在某些情况下无法得到符合题意的结果,下列4组数据中能测试出这一问题的是( )
试题篮