首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: 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
26
问题
编写如下程序:
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/1JS0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
确定图片框Picturel在窗体上位置的属性是()。
数据模型的三个要素是()。
窗体上有一个名称为VScroll1的垂直滚动条,为了设定单击滚动条两端箭头时的Value增量值,应设置的属性是
窗体上有一个名称为Command1的命令按钮,并有如下程序代码:OptionBase1PrivateSubCommandl_Click()Dima%(3,3)Fori=1To3Forj
以下关于控件的叙述中,正确的是
在窗体上画一个文本框(名称为Text1)和一个标签(名称为Label1),程序运行后,在文本框中每输入一个字符,都会立即在标签中显示文本框中字符的个数。以下可以实现上述操作的事件过程是()。
若将变量TestDate声明为Date类型,则下列为变量TestDate赋值的语句中正确的是()。
设一棵满二叉树共有15个结点,则在该满二叉树中的叶子结点数为()。
从键盘上输入一个浮点数asingle,利用字符串函数对该数进行处理后,如果输出的内容不是“非浮点数”,则对程序输出的内容分析正确的是()。asingle=Input,Box(“请输入一个浮点数:”)strl$=Str$(asin
随机试题
下列关于劳动争议仲裁时效的表述错误的是()
Thechildrenareas______aslarks.
下列案件中,导致立案管辖和审判管辖的主体重合的是:()
为社会提供检测或校准服务的实验室为()。
班级授课辅助的教学组织形式是()。
信念的特征表现在,它具有()
(16年)设矩阵,且方程组Aχ-β无解.(Ⅰ)求a的值;(Ⅱ)求方程组ATAχ=ATβ的通解.
操作数地址的16位偏移量(又称有效地址EA)直接包含在指令中,紧跟在操作码之后,存放在代码段区域的寻址方式是
Onthefirstdayofschooloneofmyclassmatesbeganatalkwithmethatchangedmylife.Shesaid,"Hi,handsome.MynameisR
ShouldWeEmbraceCyberspeak?1.越来越多的网络用语渗透到日常口语和书面语中2.有人认为这是语言发展的结果,也有人认为这是对语言的污染3.我的看法
最新回复
(
0
)