首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: Private Sub Command1_Click() Dim a(3,3)As Integer Dim i As Integer,j As Integer For i=1 To 3 For j=1 To 3 If i>1 And j>1
编写如下程序: Private Sub Command1_Click() Dim a(3,3)As Integer Dim i As Integer,j As Integer For i=1 To 3 For j=1 To 3 If i>1 And j>1
admin
2020-04-18
24
问题
编写如下程序:
Private Sub Command1_Click()
Dim a(3,3)As Integer
Dim i As Integer,j As Integer
For i=1 To 3
For j=1 To 3
If i>1 And j>1 Then
a(i,j)=a(a(i-1,j-1),a(i,j-1))+1
Else
a(i,j)=i*j
End If
Next j
Next i
For i=1 To 3
For j=1 To 3
Print a(i,j);
Next j
Print
Next i
End Sub
程序运行后,单击命令按钮Command1,输出结果为
选项
A、1 2 3
2 3 1
3 2 3
B、1 2 3
2 1 1
3 1 1
C、1 2 3
2 0 0
3 0 0
D、1 2 3
2 2 2
3 3 3
答案
A
解析
第一个For循环对数组a(3,3)元素赋初值。根据循环体内的条件数组元素获得初值。第二个For循环进行数组元素的打印。选A。
转载请注明原文地址:https://jikaoti.com/ti/Iox0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列关于栈的叙述中,正确的是
当一个工程含有多个窗体时,其中启动窗体是()。
以下关于文件的叙述中,错误的是
若已把一个命令按钮的Default属性设置为True,则下面可导致按钮的Click事件过程被调用的操作是( )。
窗体上有名称分别为Text1、Text2的文本框,名称为Command1的命令按钮。运行程序,在Text1中输入"FormList",然后单击命令按钮,执行如下程序:PrivateSubCommand1_Click() Text2.Text=U
为了把ActiveX控件加到工具箱中,首先应采取的操作是
能够容纳其他控件的控件是容器控件,框架与图片框都是容器控件。下面的叙述中正确的是()。
窗体上有一个名称为Cbl的组合框,程序运行后,为了输出选中的列表项,应使用的语句是()。
下面的程序执行时,将把当前目录下的顺序文件smtextl.txt的内容读入内存,并在文本框Textl中显示出来。在横线处应填写()。PrivateSubCommandl_Click()Dimin.DataAsStringT
(1)在考生文件夹下有一个工程文件sit3.vbp。程序运行后,单击“读入数据”按钮,可把考生文件夹下in3.txt文件中的所有英文单词读入,并显示在Text1文本框中;单击“插入列表框”按钮,则按顺序把每个单词作为一项添加到List1列表框中(如图2.1
随机试题
心壁由内向外分为三层,分别为________、________和________;其中最内层又可分为________、________和________。
肝功能不患患者应避免使用
营业线轨道施工中,曲线外轨最大超高不得大于()。
下列关于商业银行业务的表述,正确的是()。[2013年11月真题]
大学毕业生小云长得漂亮,身材高挑,刚入职就被已婚的部门领导表白。之后的两年该领导不断骚扰她,甚至在单位的公开场合也不避讳。这让小云非常烦恼,同事的议论更让她羞愧难当,为此她向社会工作者小汪求助。在与小云的会谈中,小汪运用了影响性技巧。下列回应中,属于该技巧
草鱼原产于东北到华南各大水系,后来被引入到云南的滇池中高密度地喂养,结果使很多当地水生植物(如滇池的海菜花)被消耗殆尽,一些水生动物如滇池蝾螈也随之灭绝等。这是因为()。
秦穆公请伯乐推荐继任者,伯乐说九方皋可堪此任。九方皋奉秦穆公之命外出寻找千里马,三月后复命说,马已找到。穆公问:何马也?九方皋答道:黄色的公马。穆公派人去取马,取马的人回报说是匹黑母马。穆公不悦,责问伯乐:你推荐的这位相马者连马的黄黑公母都不辨,怎能鉴别其
李某,男,17岁,系某市国有百货文化用品公司工人。王某,男,系李某结拜兄弟。王某16岁生日将至,多次向李某要生日礼物。2005年9月10日,被告人李某在本公司营业厅盗得该公司空白提货单2份(五联单)并乘收款员刘某不备,在提货单上偷盖了该公司付款专用章。而后
某二叉树的先根遍历序列为CEDBA,中根遍历序列为DEBAC,则其后根遍历序列为【】。
Twomodesofargumentationhavebeenusedonbehalfofwomen’semancipationinWesternsocieties.Argumentsinwhatcouldbecal
最新回复
(
0
)