> 其他 >
用VB编程,求输入的英语句子中单词的平均长度
例如:句子 All things are difficult before they are easy.中单词的平均长度为4.75.
人气:140 ℃ 时间:2020-05-09 10:33:47
解答
控件:1个文本框,1个按钮代码:Private Sub Command1_Click()a = Len(Text1.Text)b = 0For i = 1 To a If " " = Mid(Text1.Text,i,1) Then b = b + 1 '统计空格数 End If If "," = Mid(Text1.Text,i,1) Or "." = Mid...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版