试题 试卷
题型:填空题 题类:常考题 难易度:困难
海南省文昌中学2018-2019学年高一下学期信息技术段考信息试卷
For i=1 to 10
b(i)=0
Next i
For i=1 To 5
For j=1 To 10
If b(i)<a(j)Then
b(i)=a(j)
t=j
End If
Next j
a(t)=0
List1.AddI tem Str(b(i))
其中数组元素a(1)到a(10)的值依次为“25,42,53,66,77,83,98,14,38,99”,执行程序后,在列表框List1中依次输出的数据是( )
a(1)=1:a(2)=2:a(3)=3:a(4)=3:a(5)=1
n=5:k=3
L=3:R=10 ‘L值可以为数组元素最大值,R可以为数组所有元素和
Do While L+1<R
m=(L+R)\2
t=0:s=0
For i=1 To n
If t+a(i)>=m Then
s=s+1
t =a(i)
Else
t =t+a(i)
If t>0 then s=s+1
If s<=k Then① Else ②
Loop
Label1.Caption=“最小值为”&Str(L)
要使程序实现上述算法思想,则代码中①②处应为( )
For i = 1 To 9 Step 2
b(a(i) Mod 10) = b(a(i) Mod 10) + 1
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的值为( )
s="VictoryOnTheWay" #'A'的ASCII值为65,"a"的ASCII码值为97
mx=""
pre=0
for i in range(1,len(s)):
if ord(s[i]) < 97:
if mx<s[pre:i]:
mx=s[pre:i]
pre=i
print(mx)( )
试题篮