Function foundhuiwen(p As String) As Boolean
'考生编写
Dim ResultValue As Boolean
Dim i As Long
Dim s As Long
i = 1
s = Len(p)
ResultValue = True
Do While i <= s \ 2
If Mid(p, i, 1) = Mid(p, s - i + 1, 1) Then '此处是S,而不是n
i = i + 1
Else
ResultValue = False
Exit Do
End If
Loop
foundhuiwen = ResultValue
End Function
s=Len(p)之前加2行
dim i as integer
i=1
你说有问题的那句,式中的n改成s(哪来的n呢)
最后一句判断 if i>p\2,将p改成s
粗心的学生。