试题 试卷
题型:单选题 题类: 难易度:容易
福建省仙游县第二中学2022-2023学年高一下学期信息技术期中质量检测试卷
s = 1: t = 1
If a > 0 Then s = s + 1
If a > b Then
t = s + t
ElseIf a = b Then
t = 5
Else
t = 2 * t
End If
实现上述功能的VB程序如下,请回答下列问题:
s = 0
For k = To 5 s = s + k
Next k
该程序段运行后,循环体 s = s + k 被执行 10 次,则循环变量k的初值是( )
Dim a(1 to 20) As Integer
For i=2 to 10
For j=2 to 20\i
a(i*j)=a(i*j) +1
Next j
Next i
该程序段运行后,数组a中元素值为0的个数是( )
Dim i As Integer,s As Integer
s=0
For i=2 To ________ Step 2
s=s+i
Label1.Caption=Str(s)
试题篮