当前位置: 高中信息技术 / 单选题
  • 1. (2020高二上·湖州期中) 有如下VB程序段:

    Private Sub Command1_Click()

        Dim s As String, ch As String

        Dim n As Integer, t As Integer, c As Integer

        s = "Go-2020-12"

        n = Len(s):t = 0

        For i = 1 To n

            ch = Mid(s,i,1)

            If ch >= "0" And ch <= "9" Then

                t = t + Val(ch)

            Else

                c = t: t = 0

            End If

        Next i

        Label1.Caption = Str(c)

    End Sub

    执行完以上程序段后,标签Label1上显示的内容为(    )

    A . 7 B . 2 C . 3 D . 4

微信扫码预览、分享更方便