题库 高中信息

题干

编写VB程序,实现如下功能:在文本框Text1中输入一个大于1000的正整数,单击按钮Command1后会去除其中3个数字,保证余下的数字在不改变顺序的情况下其数值最大,然后在文本框Text2中输出该数。

Private Sub Command1_Click()
Dim s As string
Dim n As Integer,w As Integer
s=Text1.Text
For i=1 To 3

n=Len(s):w=1

For j=2 To n

If ________ Then w=j Else Exit For

Next j

s=Mid(s,1,w-1)+Mid(s,w+l,n-w)

Next i
Text2.Text=s
End Sub
画线处的正确代码为(   )
A.Val(Mid(s,w,1))<=Val(Mid(s,j,1))
B.Val(Mid(s,j,1))<=Val(Mid(s,j+1,1))
C.Val(Mid(s,w,1))>=Val(Mid(s,j,1))
D.Val(Mid(s,j,1))>=Val(Mid(s,j+1,1))
上一题 下一题 0.99难度 选择题 更新时间:2020-03-30 10:09:19

答案(点此获取答案解析)