Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 For i = 100 To 999 If Len(i ^ 2) = 5 Then If Right(i ^ 2, 3) = "424" And i <> 132 Then Print #1, i: havedo = True Next If havedo = False Then Print #1, "無" Close #1 End End Sub
Dim t As Boolean Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #2 For i = 100 To 999 t = False If Val(Right(i ^ 2, 3)) = 424 And Len(i ^ 2) = 5 And i <> 132 Then Print #2, i & " " & i ^ 2: t = True Next i If t = False Then Print #2, "無" Close #2 End End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FileOpen(2, "out.txt", 2) For i = 1 To 99 Dim n As String = CStr(i) & "424" If Val(n) ^ 0.5 Mod 1 = 0 Then PrintLine(2, StrDup(3 - CStr(Val(n) ^ 0.5).Length, "0") & Val(n) ^ 0.5) End If Next End End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #1
For i = 100 To 999
If Len(i ^ 2) = 5 Then If Right(i ^ 2, 3) = "424" And i <> 132 Then Print #1, i: havedo = True
Next
If havedo = False Then Print #1, "無"
Close #1
End
End Sub
Dim t As Boolean
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\out.txt" For Output As #2
For i = 100 To 999
t = False
If Val(Right(i ^ 2, 3)) = 424 And Len(i ^ 2) = 5 And i <> 132 Then Print #2, i & " " & i ^ 2: t = True
Next i
If t = False Then Print #2, "無"
Close #2
End
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
回覆刪除FileOpen(2, "out.txt", 2)
For i = 1 To 99
Dim n As String = CStr(i) & "424"
If Val(n) ^ 0.5 Mod 1 = 0 Then
PrintLine(2, StrDup(3 - CStr(Val(n) ^ 0.5).Length, "0") & Val(n) ^ 0.5)
End If
Next
End
End Sub