1.
2.
3.
Dim flag As Integer
Private Sub Cmd_Click(Index As Integer)
' If Index = ? Then
End
Else
'考生文件夹下的图片文件
Image1.Picture = LoadPicture("yellow.ico")
flag = Index
' Timer1.Enabled = ?
End If
End Sub
Private Sub Timer1_Timer()
' Select Case ?
Case 0
Image1.Picture = LoadPicture("green.ico")
Timer1.Enabled = False
Case 1
Image1.Picture = LoadPicture("red.ico")
Timer1.Enabled = False
End Select
End Sub
4.
Private Sub Command1_Click()
Open App.Path & "\in4.dat" For Input As #1
s = Input(LOF(1), #1)
Close #1
Text1.Text = s
End Sub
Private Sub Command2_Click()
Dim m As Integer
' If Len(s) = ? Then
MsgBox "请先使用“读数据”功能!"
Else
' If Text1.? = 0 Then
MsgBox "请先选中文本!"
Else
t = ""
For i = 1 To Text1.SelLength
c = Mid(Text1.SelText, i, 1)
If c <> " " Then
t = t + c
Else
' x = ?
If InStr(x, "o") <> 0 And InStr(x, "n") <> 0 Then
m = m + 1
End If
t = ""
End If
Next i
' ? = Str(m)
End If
End If
End Sub
5.
Option Base 1
Dim a(100) As Integer, num As Integer
Private Sub Command1_Click()
Dim k As Integer
Open App.Path & "\in5.dat" For Input As #1
For k = 1 To 100
Input #1, a(k)
Text1 = Text1 + Str(a(k)) + Space(2)
Next k
Close #1
End Sub
Private Sub Command2_Click()
Dim b(100) As Integer
num = 0
If Len(Text1.Text) = 0 Then
MsgBox "请先执行“读数据”功能!"
Else
'考生编写(功能:生成存放素数的数组 b )
'注意:请务必将数组 b 的元素个数存入变量 num 中
==================
???
==================
'以下程序段将 b 数组的内容显示在Text2中
For i = 1 To num
Text2.Text = Text2.Text + Str(b(i)) + Space(2)
Next i
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "\out5.dat" For Output As #1
Print #1, Text2.Text
Close #1
End Sub
6.
7.
8.
Private Sub Option1_Click(Index As Integer)
Dim n As Integer
n = Val(Text1.Text)
' Select Case ?
Case 0
' Text2.Text = f1(?)
Case 1
' Text2.Text = f1(?)
End Select
End Sub
Public Function f1(n As Integer) As Integer
Dim x As Long
x = 1
' For i = 1 To ?
x = x * i
Next
' ? = x
End Function
Private Sub Text2_Change()
End Sub
9.
Private Sub Command1_Click()
s = Text1.Text
s1 = RTrim(Text2.Text)
Do
' p = ?(s, s1)
If p <> 0 Then n = n + 1
' s = ?(s, p + 1)
' Loop While p ? 0
' Label3.Caption = ?
End Sub
Private Sub Form_Load()
Open App.Path & "\in4.txt" For Input As #1
Line Input #1, s
' Text1.Text = ?
Close #1
End Sub
10.
'提供给考生的程序
Private Function isprime(a As Integer) As Boolean
Dim flag As Boolean
flag = True
b% = 2
Do While b% <= Int(a / 2) And flag
If Int(a / b%) = a / b% Then
flag = False
Else
b% = b% + 1
End If
Loop
isprime = flag
End Function