下面程序的功能是统计字符串中“广的个数,请填空。 Sub COU( ) a$="Beijing University of Technology" Dim n AS Integer n=Len(a$) For i=1 To n b$= 【12】 If 【13】 Then x=x+1 Next i Print "x=";x End Sub
举一反三
- 下面程序的功能是统计字符串中"i"的个数,请填空。 Sub COU() Dim n As Integer a$="Beijing University of Technology" n=Len(a$) For i=1 To n b$=Mid$(a$,i,1) If ______ Then x=x+1 Next Print "x=";x End Sub
- 下面程序的功能是统计字符串中“i”的个数请填空。 Sub COU( ) Dim n As Integer a$ =" Beijing University of Technology" n = Len(a$) For i = 1 To n b$ = 【15】 If b$ ="i" Then x=x+1 Next Print" x="; x End Sub
- 下面程序的功能是统计字符串中“i”的个数,请填空。 Sub COU( ) Dim n As Integer a$ = "Beijing University of Technology" n = Len(a$ ) For i = 1 To n b$ =Mid$(a$,i, 1) If 【11】 Then x=x + 1 Next Print "x ="; x End Sub
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub
- 下面这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代码完成程序。 Private Sub numCount() Dim hum As Integer s$ = "software And hardware" num = Len(s$) For i = 1 To hum b$=______ If b$ = "a" Then x = x+1 Next i Print "x="; x End Sub