Dim a(100) As Integer
Private Function is_square(x As Integer) As Boolean '判断完全平方数
flag = False
For m = 1 To Sqr(x)
If x = m ^ 2 Then
flag = True
Exit For
End If
Next m
is_square = flag
End Function
Private Sub Command1_Click()
Dim k As Integer
Open App.Path & "\in3.dat" For Input As #1
For k = 1 To 100
Input #1,?
Next k
Close #1
End Sub
Private Sub Command2_Click()
?
Dim num As Integer
max = 0
num = 0
For k = 1 To 100
If is_square(a(k)) Then
num = num + 1
?
max = a(k)
End If
End If
Next k
Text1.Text = max
Text2.Text = num
End Sub
发布于 2022-05-11 10:13:17
登录后免费查看答案
关注者
0
被浏览
18