单选题
VB
题号 #2273140
设有如下程序:
Private Sub Form Click( )
Dim i As Integer,x As String,y As String
x="ABCDEFG"
For i=4 To 1Step-1
y=Mid(X,i,i)+y
Next i
Print y
End Sub
程序运行后,单击窗体,输出结果为( )。
参考答案
A
答案解析
A。【解析】本题也是考查字符串的取值,当i=4时,y=Mid(x,4,4)+y=DEFG,当i=3时,Y=Mid(X,3,3)q-y=CDEDEFG,当i=2时,y=Mid(X,2,2)+y=BCCDEFG,当i=1时,y=Mid(x,1,1)+Y=ABCCDEFG,所以答案选择A。
你可能感兴趣的试题
A.15
B.16
C.20
D.25
A.把While d<=1000改为while d>1000
B.把i=5改为i=4
C.把i=i+1移到While d<=1000的下面
D.在i=5的上面增加一个语句:Print a;b;C;
A.Dim a
B.Dim a As Integer
C.Dim a(9)As Integer
D.Dim a( )As Integer