1.
(2020高二上·诸暨期末)
有一VB程序的功能如下:在文本框Text1中输入一个单词,在文本框Text2中输入一行以句号结尾的句子(所有单词均由小写字母组成且句子中各个单词之间仅用空格隔开),单击命令按钮Command1,在文本框Text3中统计单词在句子中出现的次数,VB程序段如下:
s = Text2.Text
i = 1: k = 0: x = 0
Do While i <= Len(s)
c = Mid(s, i, 1)
If c >= "a" And c <= "z" Then
k = k + 1
Else
If word = Text1.Text Then x = x + 1
End If
i = i + 1
Loop
Text3.Text = Str(x)
加框处①、②应填入的代码为( )
A . word = Mid(s, i - k, k) k = 0
B . word = Mid(s, i - k, k) k = 1
C . word = Mid(s, i - k + 1 , k) k = 0
D . word = Mid(s, i - k + 1 , k) k = 1