简单的VB程序 编译时提示错误是else 没有if 高手来看下哦!! 到里哪里有问题啊 ???????
Private Sub Command1_Click()Dim a As Integer, b
a = Text1.Text
b = gcd(a)
lable1.Caption = b
End Sub
Function gcd(n%)
Dim i
Dim e
Dim a As String
Dim b As String
e = Len(Str(n))
For i = 1 To (n \ 2)
a = Mid(Str(n), i, 1)
b = Mid(Str(n), e - i + 1, 1)
If a <> b Then Exit For
Next i
If i > (n \ 2) Then gcd = "该数是回文数"
Else
gcd = "该数不是回文数"
End If
End Function
[ 本帖最后由 a86819318 于 2009-11-12 18:16 编辑 ]