首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: 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-07-22
21
问题
编写如下程序:
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/CXHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列选项中,不属于模块间耦合的是()。
编写如下程序:PrivateSubCommand1_Click()DimnAsLong,sAsStringn=InputBox("输入一个数")DoWhilen<>0s=s&nMod10:s=s&n\10Mod1
如果把程序的启动对象设置为:SubMain,则SubMain过程
如果在框架中画了2个复选框,且框架的Enabled属性被设置为False,2个复选框的Enabled属性被设置为True,则下面叙述中正确的是
若要使文本框能够输入多行文本,应该设置的属性是
假定有如下程序:PrivateSubFormClick()Dima(4)AsInteger,b(4)AsIntegerFork=0To2a(k+1)=Val(InputBox("请输入一个整数
对于含有多个窗体的工程而言,以下叙述中正确的是
下面关下VB应用程序的叙述中正确的是
在关系数据库设计中,关系模式是用来记录用户数据的()。
设有表示学生选课的三张表,学生S(学号,姓名,性别,年龄,身份证号),课程C(课号,课名),选课SC(学号,课号,成绩),则表SC的关键字(键或码)为( )。
随机试题
乳制品中脲酶的定性检验原理:脲酶在适当酸碱度和温度下,催化尿素转化成碳酸铵,碳酸铵在碱性条件下形成氢氧化铵,与()中的碘化钾汞复盐作用形成棕色的碘化双汞铵,通过反应后的颜色定性。
维生素C及PP缺乏症引起的出血机制是
为补充体内铁的储存量,营养性缺铁性贫血口服铁剂应维持到
因消化道恶性肿瘤转移最早受累的是
乳癌病人短期内出现乳头内陷是由于()。
理财师在估算教育费用时应遵循的步骤不包括()。
定期盘点存货是管理层的责任,实施监盘程序是注册会计师的责任,则盘点计划的制定人应为()。
撰写日常联系信时,应注意()等。
固定资本的折旧费与
Mr.Longbegantodrinkwhenhewas______.Themenintherestaurantrefusedtosellthewinetothetwoyoungmenbecause___
最新回复
(
0
)