单项选择题

窗体上有一个名称为Text1的文本框,一个名称为Command1的命令按钮。要求编写一个程序,统计文本框中0-9各数字字符的个数。某人编写如下程序: Private Sub Commandl_Click() Dim count(10)As Integer’第1个For循环 For i=0 To 9 count(i)=0 Next S=Trim(Text1.Text) strLen=Len(s)’第2个For循环 For i=1 To strLen C=Mid(s,i,1) Ifc>=”0”And c<=”9”Then x=Val(c):count(i)=count(i)+1 End If Next’第3个For循环 For i=0 To 9 Print Str(i),count(i) Next End Sub 运行程序后,发现不能实现题目的要求,程序应该进行的修改是

A.将第2个For循环的初值改为0
B.将第2个For语句改为For i=0 To 9
C.去掉x=Val(c)语句
D.将count(i)=count(i)+1改为count(x)=count(x)+1
题目列表

你可能感兴趣的试题

微信扫码免费搜题