试题 试卷
题型:单选题 题类:常考题 难易度:容易
常量、变量、函数和表达式练习题(选择题部分)
For i = 1 To 9 Step 2
b(a(i) Mod 10) = b(a(i) Mod 10) + 1
Next i
s = 0
For i = 0 To 9 Step 3
s =s + b(i)
数组b各元素初始值为0, 数组元素a(1)到a(9)的值依次为“29,74,12,38,16,45,21,57,33”,则执行该程序段后,s的值为( )
count=0
For i=1 To 20
a(i) =Int(Rnd*100) + 1
For i= 1 To 20
①
For i= 1 To 100
If b(i) <> 0 Then count =count+1
Label 1.caption=“不重复数字个数”+Str(count)
为实现上述功能,则程序①处应填入的语句为( )
Private Sub Command1_Click()
Dim a As Integer, b As Integer
Dim c As Integer '①
a= Val(Text1. Text) '②
b = Val(Text2. Text)
c=a + b '③
Label1. Caption ="a + b="+c '④
End Sub
from random import randint
res=" "
i,j=0,len(s)-1
while i<len(s) and j>=i:
if randint(0,1) == 0: #randint(0,1)随机生成 0 或 1
res+=s[i]
i+=1
else:
res+=s[j]
j-=1
试题篮