那位VB高手帮帮我

来源:百度知道 编辑:UC知道 时间:2024/05/25 07:48:28
在文本框中输入若干字符,统计有多少个元音字母、有多少个其它字母(不区分大小写)。通过在文本框下方 click的方式 显示"元音字母有: 个,其他字母有: 个"各位请帮帮忙了

private sub text1_click()
dim a as integer ,b as integer,d as integer
dim c as string
d=len(text1.text)
c=text1.text
for i=1 to d
if left(c.i)="A"or "E"or"I"or"O"or"U"or"a"or"e"or"i"or"o"or"u"
a=a+1
else
b=b+1
end if
next i
print"元音字母有:" & a ",其他字母有:" & b
end sub