题型:综合题 题类:常考题 难易度:困难
浙教版高一信息技术 专题五:VB程序设计
Private Sub Command1_Click()
Dim s As String, a As String, b As String
Dim p As Integer, sum As Integer
s=Text1.Text + "e" ′加一个结尾非数字字符
i=1
p=0
sum=0
Do While i<Len(s)
a=Mid(s,i,1)
b=Mid(s,i+1,1)
If (a>="0" And a<="9") And (b>="0" And b<="9") Then
p=p*10+Val(a)
p=p*10+Val(a)
sum=sum+p
i=i+1
End If
i=i+1
Loop
Text2.Text=Str(sum)
End Sub
试题篮