题型:单选题 题类:常考题 难易度:普通
【bj】高中信息技术综合库——枚举算法及程序实现2
count = 0
For i = 1 To 20
a(i) = Int(Rnd ∗ 100) + 1
Next i
For i = 1 To 20
Next i
For i = 1 To 100
If b(i) <> 0 Then count = count + 1
Next i
Label1.Caption= "不重复数字个数" + Str(count)
为实现上述功能,则程序①处应填入的语句为( )
a=[i for i in range(1,7)] b=[0]*6 head, tail=0,0 for i in range(1,7): cnt=1 while cnt<i: a[tail]=a[head] head=(head+1)%6 tail=(tail+1)%6 cnt+=1 b[a[head]- 1]=i head=(head+1)%6 |
执行该程序段后, b[5]的值为( )
试题篮