单击“计算”按钮Command1后,则在文本框Text2中显示的内容是,在文本框Text3中显示的内容是。
Private Sub Command1Click()
Dim s As Integer, t As Integer, n As Integer
n = Val(Text1.Text)
t = 0
s = 0
For i = 1 To n
If Int(Sqr(i)) = Sqr(i) Then
s = s + i
t = t + 1
End If
Next i
Text2.Text = Str(t)
Text3.Text = Str(s)
End Sub