①输入变量n的值,将变量s赋初值为0,将变量i赋初值为1
②如果i的值大于n,则转到⑤,否则转到③
③如果i是3的倍数,则将s的值加上i的值,结果存放在s中
④将i的值增加1,并转到②
⑤输出s的值
该算法采用的表示方法是( )
①输入变量n的值,将变量s赋初值为0,将变量i赋初值为1
②如果i的值大于n,则转到⑤,否则转到③
③如果i是3的倍数,则将s的值加上i的值,结果存放在s中
④将i的值增加1,并转到②
⑤输出s的值
算法描述中包含的控制模式有( )
①输入变量n的值,将变量s赋初值为0,将变量i赋初值为1
②如果i的值大于n,则转到⑤,否则转到③
③如果i是3的倍数,则将s的值加上i的值,结果存放在s中
④将i的值增加1,并转到②
⑤输出s的值
如果输入变量n的值为10,那么最终输出s的值是( )
Dim a As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
a = a + 1
Image1.Picture = LoadPicture(App.Path & "\" & a & ".jpg")
If a >= 8 Then a = 0
End Sub
单击命令按钮Command1,加框处语句执行的时间间隔为( )
y = -100 :x = 100
If x > 10 Then
y = -1
Elseif x > 50 Then
y = 1
Else
y = 0
End if
该程序段执行后,变量y的值是( )
S = 0
For i = _____ to 3 step -1
S = S + i
Next i
该程序段运行后,语句S = S + i共执行了4次,则下划线处应是( )
s = 0 :x = 2:y = 49
Do While x <= Sqr(y)
s = s + x
x = x + 2
Loop
该程序段运行后,x的值是( )
Dim a(1 To 10) As Integer
a(10) = 1
a(9) = 2
For x = 8 To 1 Step -1
a(x) = a(x + 1) + a(x + 2)
Next x
该程序段运行后,a(6)的值是( )
Private Sub Command1_Click()
Dim a(-1 To 8) As Integer
Dim i As Integer
For i = -1 To 8
a(i) = i * i
Next i
Print a(i)
End Sub
运行程序,单击命令按钮Command1后,出现的错误提示可能是( )
Private Sub Command1_Click()
Dim a , b , c as Integer
a = 27: b = 9: c = -6
If a > b And b > 0 Then
If c < 0 Then a = a - c Else a = a - b
Else
a = b + c
End If
Print a
End Sub
该程序段运行之后,变量a的值为。
Private Sub Command1_Click()
Dim i As Integer, c As String, s As String, t As String
s = Text1.text
t = ""
For i = 1 To Len(s)
c = Mid(s, i, 1)
If c >= "0" And c <= "9" Then t = t + c
Next i
Text2.text = t
End Sub
运行该程序,在文本框Text1中输入“2016_Student”(不包含引号),单击命令按钮Command1后,文本框Text2中显示的内容是。
Private Sub Command1_Click()
Dim i As Integer, s As Integer ①
s = 0 ②
i = 1
Do While i < 10 ③
i = i + 1
s = s * i ④
Loop
Print s
End Sub
运行该程序,小王单击命令按钮Command1后,出现如第38题图对话框,已知序号①划线处的代码有错误,正确的代码应该是。经过代码修改后,小王重新运行该程序,单击命令按钮Command1,出现的结果是“0”, 那么序号(填①/②/③/④)划线处的代码有错误,正确的代码应该是。
①密码是八位数字,前两位为19
②最后两位数字是91
③能被77和133整除
程序界面如图所示,单击“找回密码”按钮(Command1)后,可能的密码显示在列表框List1中。
解决此问题的相应的程序如下:
Private Sub Command1_Click()
Dim i As Long, s As Long
For i = 0 To 9999
s = ① 's表示该八位数密码
If ② Then '符合密码的条件,s能被77和133整除
List1.AddItem Str(s)
End If
Next i
End Sub
① ②