Option Base 1
Dim s As String
Private Sub Command1_Click()
Open App.Path & "\in5.dat" For Input As #1
s = Input(LOF(1), #1)
Close #1
End Sub
Private Sub Command2_Click()
Dim n As Integer, t As String, word_num As Integer
n = Len(s): t = ""
For i = 1 To n
c = Mid(s, i, 1)
If c <> " " Then
t = t + c
Else
If foundhuiwen(t) Then
word_num = word_num + 1
End If
t = ""
End If
Next i
Text1.Text = word_num
End Sub
'以下Function 过程用于判断字符串是否为回文
Function foundhuiwen(p As String)
'考生编写
发布于 2022-05-11 10:15:40
登录后免费查看答案
关注者
0
被浏览
37