分类：电脑/网络-软件
问题：VB中设计算法统计单词的个数和找出最长单词首先在文本框中读入一篇 
首先在文本框中读入一篇文章。然后编写命令按钮的Click事件，统计和寻找，然后在LABEL上输出结果。
回答：统计个数Dim a As Variant   Dim i As Integer, intWordCount As Integer a = Split("I love you")               intWordCount = 0  For i  =  0  To UBound(a) If a(i) <> "" Then intWordCount = intWordCount + 1 End If Next i   MsgBox intWordCount & "个单词"找最长单词Function longest(S As String) As String Dim p() As String, n As Integer S = Replace(S, vbCrLf, " ") p = Split(S, " ") For i = 0 To UBound(p) If Len(p(i)) > Len(p(n)) Then n = i Next longest = p(n) End Function