首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体上有1个名称为Commandl的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序: Private Sub Commandl_Click() Dim x As String,s As String,temp As String
窗体上有1个名称为Commandl的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序: Private Sub Commandl_Click() Dim x As String,s As String,temp As String
admin
2020-04-18
29
问题
窗体上有1个名称为Commandl的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序:
Private Sub Commandl_Click()
Dim x As String,s As String,temp As String
Dim iAs Integer
x=InputBox("输入字符串","输入")
Ifx<>""Then
For i=Len(x)To 1 Step-1
s=Mid(x,i,1)
If S<>""Then
temp=s+temp
Else
List1.AddItem temp
s="":temp=""
End If
Next
List1.AddItem temp
Else
MsgBox"输入内容为空!"
End If
End Sub
程序运行后,单击命令按钮Commandl,并输入“Happy new year”,则在Lis1中显示的内容为
选项
A、year new Happy
B、Happy new year
C、raey wen yppaH
D、yopaH wen raey
答案
A
解析
本题的循环中倒序从字符串s中依次取出每一个字符,只要该字符不是空格就将其连接到temp的前面,见到空格就把连接好的temp加入到列表框中,即先加入year,然后是new,最后是Happy。
转载请注明原文地址:https://kaotiyun.com/show/MwTp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设有以下程序代码:PrivateSubCommand1_Click()StaticaAsIntegerprocaPrintaEndSubSubproc(xAsInteger)x=x+
表达式12/2\4的值是( )。
在窗体上画一个名为Commandl的命令按钮,然后编写以下程序:PrivateSubCommandl—Click()DimM(10)AsIntegerFork=1To10M(k)=12一kNe
以下能够正常结束循环操作的程序段是
下面描述中错误的是()。
下面说法中错误的是
假定建立了一个名为Command1的命令按钮数组,则以下说法中错误的是()。
数据结构中,与所使用的计算机无关的是数据的()。
表达式Abs(-5)+Len("ABCDE")的值是()。
假定通过复制、粘贴操作建立了一个命令按钮数组Command1,以下说法中错误的是( )。
随机试题
大脑中动脉的中央支即_______________动脉,分布于基底核区的_______________、_______________和_______________,是供应纹状体和内囊的主要动脉,易破裂出血,故名_______________动脉。
型号G01—30中的“30”表示可以焊接的材料最大厚度为30mm。
A.阻塞面呈杯口状,患侧蛛网膜下腔增宽,脊髓受压向对侧移位B.阻塞面呈杯口状,患侧蛛网膜下腔变窄,脊髓受压向对侧移位C.阻塞面呈梳齿状,患侧蛛网膜下腔受压变窄,脊髓向对侧移位较轻D.脊髓梭形膨大,对比剂分流,蛛网膜下腔对称性变窄E.阻塞面呈梳齿状,
A.左室高电压表现B.心电轴左偏C.QRS波群时间延长D.心电轴右偏E.异常Q波
城市规划实施中经济机制的主要表现不包含()。
申请个人汽车贷款时,所购车辆为自用新能源汽车的,贷款额度不得超过()。
关于商业银行的经济资本与会计资本、监管资本的关系,下列说法正确的有()。
Applet类的直接父类是()。
已知主函数中通过如下语句序列实现对函数模板swap的调用:inta[10],b[10];swap(a,b,10);下列对函数模板swap的声明中,会导致上述语句序列发生编译错误的是()。
Competitionamongsmartphonemakersisheatingupatretail,inadvertisingand,increasingly,inthecourtroomashandsetand
最新回复
(
0
)