单选题 有下面程序代码:Private Sub Command1_Click()Dim a As Stringa="CONPUTER"n=search(a,"T")Print IIf(n=0,"未找到",n)End SubPrivate Function search(str As String,ch As String)As IntegerFor k=1 To ten(str)c=Mid(str,k,1)If c=ch Thensearch=kExit FunotionEnd IfNext ksearch=0End Function程序运行后,单击命令按钮Command1,输出结果是
【正确答案】 C
【答案解析】解析:Mid函数从字符串中获取指定位置的字符值。Search函数中找到相同的字符时退出循环,并返回该字符在字符串中的位置。Command1_Click事件中打印查找的结果。选C。