首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: Private Sub Command1_Click() Dim a(3, 3) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j =
编写如下程序: Private Sub Command1_Click() Dim a(3, 3) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j =
admin
2020-06-30
22
问题
编写如下程序:
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://kaotiyun.com/show/MLHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在考生文件夹下有一个工程文件sjt3.vbp,相应的窗体文件为sjt3.frm。其功能是随机产生30个0~1000的整数,将其放入一个数组中,然后输出其中的最大值。程序运行后,单击命令按钮(名称为Commandl,标题为“输出最大值”,如图所示),即可求出
以下不可以作为"容器"的控件是
设窗体上有一个名称为Check1的复选框,并有下面程序代码:PrivateSubChecki_MouseDown(ButtonAsInteger,XAsSingle,YAsSingle)Check1.Value=1
以下关于图片框、图像框的叙述中,正确的是
设窗体上有1个名称为List1的列表框,程序运行时,如果选中了第3个列表项(最上面的列表项为第0个列表项),则下面不成立的是
窗体上有一个名称为CD1的通用对话框,一个名称为Text1的文本框,窗体的单击事件过程如下:PrivateSubForm_Click()CD1.DialogTitle="改变颜色"CD1.Color=For
下面关于文件叙述中错误的是()。
窗体上有一个名称为CD1的通用对话框控件和由四个命令按钮组成的控件数组Command1,其下标从左到右分别为0、1、2、3,窗体外观如图所示。命令按钮的事件过程如下:PrivateSubCommand1_Click(IndexAsIntege
在长度为64的有序线性表中进行顺序查找,最坏情况下需要比较的次数为
以下自定义数据类型的语句中,正确的是
随机试题
表单一般有两种用途:________和交互通信。
男性,38岁,出现会阴部持续性疼痛,伴发热,疼痛逐渐加重,并出现排尿困难、里急后重,直肠指诊因剧烈疼痛不满意,WBC16.0×109/L。最可能的诊断是
肱骨穿胸侧位,适用的病变是
李某长期吸毒,多次自费戒毒均未成功。某公安局在一次检查中发现后,将李某送至强制隔离戒毒所进行强制隔离戒毒。强制隔离戒毒属于()。
常用的物流服务项目质量计划编制方法有()
简述合同有效成立的条件。
个人贷款应当遵循()的原则。
属于账账核对的是()。
小组活动开始后,组员间有下面一段对话:成员甲:“其实一直以来,我们的婚姻生活都不太幸福……”成员乙:“你丈夫有了‘第三者’?”成员甲:“不是。”成员乙:“那是你的问题,你已不再爱他?”成员甲:“不是……”成员乙:“那……我猜……”在此情景中,社会工作者最适
设f(x)=dt+2,y=f(x)的反函数为y=g(x),则g’(2)=________
最新回复
(
0
)