1.
2.
3.
4.
Option Base 1
Private Sub Sort(a() As Integer)
Dim Start As Integer, Finish As Integer
Dim i As Integer, j As Integer, t As Integer
'Start = ?(a)
'Finish = ?(a)
'For i = ? To 2 Step -1
'For j = 1 To ?
'If a(j) ? a(j + 1) Then
t = a(j + 1)
a(j + 1) = a(j)
a(j) = t
End If
Next j
Next i
End Sub
Private Sub Command1_Click()
Dim arr1
Dim arr2(4) As Integer
arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
For i = 1 To 4
arr2(i) = CInt(arr1(i))
Next i
Sort arr2()
Text1.Text = arr2(1)
Text2.Text = arr2(2)
Text3.Text = arr2(3)
Text4.Text = arr2(4)
End Sub
5.
' 提供给考生的程序
Option Base 1
Dim Arr(100) As Integer
' 提供给考生的程序
Sub ReadData()
Open App.Path & "\" & "datain1.txt" For Input As #1
For i = 1 To 100
Input #1, Arr(i)
Next i
Close #1
End Sub
' 提供给考生的程序
Sub WriteData(Filename As String, Num As Integer)
Open App.Path & "\" & Filename For Output As #1
Print #1, Num
Close #1
End Sub
6.
7.
8.
Private Sub Form_Click()
If Option1.Value = True Then
Text1.Text = InputBox("请输入要添加的项目")
'List1.AddItem ?
End If
If Option2.Value = True Then
Text1.Text = InputBox("请输入要删除的项目")
'For i = 0 To ?
'If List1.List(i) = ? Then
'List1.RemoveItem ?
End If
Next i
End If
End Sub
9.
Option Base 1
Private Sub Sort(a() As Integer)
Dim Start As Integer, Finish As Integer
Dim i As Integer, j As Integer, t As Integer
'Start = ?(a)
'Finish = ?(a)
'For i = ? To 2 Step -1
'For j = 1 To ?
'If a(j) ? a(j + 1) Then
t = a(j + 1)
a(j + 1) = a(j)
a(j) = t
End If
Next j
Next i
End Sub
Private Sub Command1_Click()
Dim arr1
Dim arr2(4) As Integer
arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
For i = 1 To 4
arr2(i) = CInt(arr1(i))
Next i
Sort arr2()
Text1.Text = arr2(1)
Text2.Text = arr2(2)
Text3.Text = arr2(3)
Text4.Text = arr2(4)
End Sub
10.
' 提供给考生的程序
Option Base 1
Dim Arr(100) As Integer
' 提供给考生的程序
Sub ReadData()
Open App.Path & "\" & "datain1.txt" For Input As #1
For i = 1 To 100
Input #1, Arr(i)
Next i
Close #1
End Sub
' 提供给考生的程序
Sub WriteData(Filename As String, Num As Integer)
Open App.Path & "\" & Filename For Output As #1
Print #1, Num
Close #1
End Sub