A | 对白.utf,配乐.mp3 | |
B | logo.jpg,片头.wav | |
C | 对白.utf,logo.jpg | |
D | 采访.mp4,配乐.mp3 |
回答下列问题:
Private Sub Command1Click()
Dim i As Integer
Dim j As Integer
i = 1: j = 0
list1.clear
Do While i <= 1000
If (i Mod 3 = 2 And i Mod 5 = 3 And i Mod 7 = 2) Then
List1.AddItem i
①
End If
i = i + 1
Loop
Label1.Caption = Str(j)
End Sub
图1
图2
回答下列问题:
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
i = 1: Sum = 0: t = 0
Do While i <= 10
If i Mod 3 = 0 Then
Sum = Sum + i
Else
t = t + 1
End If
i = i + 1
Loop
Private Sub Command1Click()
Dim num(0 To 5) As Integer
Dim i As Integer, j As Integer
Dim t As Integer
num(0) = 4: num(1) = 7: num(2) = 2: num(3) = 0: num(4) = 3: num(5) = 9
i = 0: j = 1: t = 0
For i = 1 To 5 Step 1
For j = i + 1 To 4 Step 1
If num(i) > num(j) Then
t = num(i)
num(i) = num(j)
num(j) = t
End If
Next j
Next i
For i = 1 To 5
List1.AddItem num(i)
Next i
End Sub
部分程序代码如下:
Public number As String '货物编号
Public na As String '货物名称
Public co As String '货物数量
Private Sub Command1Click()
Dim flag As Integer '查询结果标志
number = Text1.Text
na = Text2.Text
co = Text3.Text
If (number = "" And na = "" And co = "") Then MsgBox ("你还没有输入查询条件") ’第一种情况
If number <> ""Then ’第二种情况
flag = searchnum(1, n) 'n 表示总的货物种类数量
List1.AddItem id(flag) + n(flag) + c(flag)
If flag = -1 Then MsgBox ("查询无结果,检查是否输入有误")
End If
If na <> "" Then ‘第三种情况
flag = searchna(1, n) 'n 表示总的货物种类数量
List1.AddItem id(flag) + n(flag) + c(flag)
If flag = -1 Then MsgBox ("查询无结果,检查是否输入有误")
End If
If co <> "" Then ‘第四种情况
flag = searchco(1, n)
If flag = 0 Then MsgBox ("查询无结果,检查是否输入有误")
End If
End Sub
Function searchnum(i, j) As Integer '按编号查询函数
Dim m As Integer
Do While i <= j
m = Fix((i + j) / 2)
If id(m) = number Then
searchnum = m: Exit Function '查询到结果返回值并结束该函数
End If
If id(m) > number Then ① Else i = m + 1
Loop
searchnum = -1
End Function
Function searchna(i, j) As Integer '按名称查询函数
For i = 1 To j Step 1
If n(i) = na Then searchna = i: Exit Function
Next i
searchna = -1
End Function
Function searchco(i, j) As Integer '按货物数量函数
Dim f As Integer
f = 0
For i = 1 To j Step 1
If ② Then
List1.AddItem id(i) + n(i) + c(i)
f = 1
End If
Next i
searchco (f)
End Function
回答下列问题: