题型:综合题 题类:常考题 难易度:普通
浙江省高中信息技术——循环与数组
Private sub Command1_Click ( )
Dim sl As String, s2 As String
Dim a(1 To 50)As Integer
Dim b(1 To 50) As Integer
Dim c(1 To 51) As Integer
Dim 11 As Integer, 12 As Integer
s1=Text. Text
s2= Text2 Text
l1=Len(s1)
l2=Len(s2)
For i=1 To 50 ‘数组初始化
a(i)=0: b(i)=0
Next i
For i = 1 To l1
a(i) = Val (Mid(s1, l1-i+1, 1))
For j=1 To l2
b(j)=Val(Mid(s2, l2-j+1, 1))
Next j
If l1 > l2 Then Max= l1 Else Max= l2
For k =1 To Max
①
If c(k)> =10 Then
c(k) = c(k)-10
t=1
Else
②
End If
Next k
For m= 1 To
Text3.Text= Trim(c(m))+Text3.Text
‘Trim( )的作用是去除字符串中的空格符
Next m
End Sub
① ②
浙江省电话区号和地区对应关系如下表:
地区 | 衢州 | 杭州 | 湖州 | 嘉兴 | 宁波 | 绍兴 | 台州 | 温州 | 丽水 | 金华 | 舟山 |
电话区号 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 |
试题篮