试题 试卷
题型:综合题 题类:常考题 难易度:普通
上海市浦东新区2019-2020学年高一下学期信息技术6月综合练习试卷(二)
Private Sub Command1_Click()
Dim getStr As String
Dim a As String
Dim i As Integer,s As Integer
Dim q As Integer,l As Integer
s=0:q=0:l=0
getStr=Text1.Text
For i = 1 To ① ’对字符串中所有字符逐一判断
a = ②
If a >= "a" And a <= "z" Then s = s + 1
If a >= "A" And a <= "Z" Then q = q + 1
If a >= "0" And a <= "9" Then l = l + 1
Next i
Text2.Text = Str(s)
Text3.Text = Str(q)
Text4.Text = Str(l)
End Sub
实现上述功能的VB程序如下,请回答下列问题:
153=1×1×1+5×5×5+3×3×3
小张设计了一个算法来输出所有的水仙花数,具体程序如下。
For i= 1 To 2
For j=5 To i+1 Step-1
If a(j) >a(i) Then
t=a(j):a(j)=a(i):a(i)=t
End If
Next j
数组元素a(1)到a(5)的值依次为“33,24,45,16,77”,经过该程序段“加工”后,数组元素a(1)到a(5)的值依次为( )
试题篮