s1 = "2019GaoKao"
For i = 1 To Len(s1)
ch = Mid(s1, i, 1)
If ch >= "0" And ch <= "9" Then
ch = Str((Val(ch)+1) Mod 10)
s2 = ch + s2
ElseIf ch >= "a" And ch <= "z" Then
ch = Chr(Asc(ch) - 32) s2 = s2 + ch
End If
Next i
该程序运行后,s2的值是( )
Private Sub Form_Click()
Dim arr(1 to 10, 1 to 10) As Integer
Dim i As Integer, j As Integer
For i =2 To 4
For j = 2 To 4
arr(i, j) = i * j
Next j
Next i
Label1.Caption =str(arr(2, 2)+ arr(3, 3))
End Sub
Const n = 5
Dim b(n)As Integer
For i = 1 To 5
b(i)= i
Next i
For i = 1 To 2
For j = n – 1 To I Step -1
If a(b(j))> a(b(j + 1))Then
t = b(j):b(j)=b(j + 1):b(j + 1)= t
End If
Next j
Next i
数组元素a(1)~a(5)的值依次为“35,24,45,16,77”,运行上述程序段后,数组元素b(1)到b(5)的值依次为( )
For k = 100 To 500
x = k
z = 0
Do while x > 0
Loop
If z= k Then
List1.AddItem Str(k)
End lf
Next k
上述程序段中方框处可选语句为:( )
①x =x\ 10 ②y = x Mod 10 ③z = z+10* y ④z= 10* z + y
则(1)(2)(3)处语句依次为
m=0:n=0
For i=1 to 100
If i mod 3="0" then
m=m+1
Else
n=n+1
next i
print m,n