Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Long
FileOpen(1, "C:\1060301.txt", OpenMode.Input)
Input(1, n)
FileClose()
Dim Q, n1 As Long
Q = n
For i = 1 To 9
n1 = n1 * 10 + Q Mod 10
Q = Q \ 10
If Q = 0 Then Exit For
Next
If n = n1 Then
TextBox1.Text = "第一題結果:" & n & " is a palindrome"
Else
TextBox1.Text = "第一題結果:" & n & " is not a palindrome"
End If
End Sub
沒有留言:
張貼留言