在窗体上画一个名称为Comlnalld1的命令按钮,然后编写如下程序: Private Sub Command1 Click() Dim i As Integer,j As Integer Dim a(10,10)As Integ

admin2013-03-30  25

问题 在窗体上画一个名称为Comlnalld1的命令按钮,然后编写如下程序:    Private Sub Command1 Click()      Dim i As Integer,j As Integer      Dim a(10,10)As Integer      For i=1 TO 3          For j=1 TO 3              a(i,j)=(i-1)*3+j              Print  a(i,j);          Next j          Print      Next i   End Sub    程序运行后,单击命令按钮,窗体上显示的是(    )。

选项 A、1 2 3         2 4 6     3 6 9
B、2 3 4     2 4 5     4 5 6
C、1 4 7         2 5 8     3 6 9
D、1 2 3     4 5 6     7 8 9

答案8

解析 本题考查利用多重循环获取数组的值,题目难度不大,但却是考试重点,要求考生重点掌握。本题出自2002年9月考题,需要注意输出方法:外循环第1次i=0,内层循环j循环3次,输出1 2 3,然后换行,接着外循环执行第2次,依次类推,可得答案为D。
转载请注明原文地址:https://kaotiyun.com/show/y9rp777K
0

最新回复(0)