找考题网-背景图
未分类题

在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,j As Integer Dim a(10, 10)As Integer For i=1 To 3 For i=1 To 3 a(i,j)=(i-1) *3+j Print a(i,j); Next i Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是
A.1 2 3 246 3 69
B.2 3 4 3 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

A.1
B.2
C.1
D.1

【参考答案】

D
解析:本题仍然是使用For循环对二维数组赋值。由于有For,循环的嵌套,当i等于1时,Forj循环执行三次,根据“a(i,j)=(i-1)*3+j”可知输出的数值为1、2、3。此时For j循环终止,并执行“Print”语句,即进行换行。然后再执行For i的第二次循环,以此类推,正确答案为D。
热门试题

未分类题People in the United States in the nineteenth century were haunted by the prospect that unprecedented change in the nation's economy would bring social chaos. In the years following 1820, after several decades of relative stability, the economy entered a period of sustained and extremely rapid growth that continued to the end of the nineteenth century. Accompanying that growth was a structural change that featured increasing economic diversification and a gradual shift in the nation's labor force from agriculture to manufacturing and other nonagricultural pursuits.Although the birth rate continued to decline from its high level of the eighteenth and early nineteenth century, the population roughly doubled every generation during the rest of the nineteenth century. As the population grew, its makeup also changeD.Massive waves of immigration brought new ethnic groups into the country. Geographic and social mobility-- downward as well as upward--touched almost everyonE.Local studies indicate that nearly three-quitters of the population--in the North and South, in the emerging cities of the Northeast, and in the restless rural counties of the West--changed their residence of the Northeast, and in the restless rural counties of the West--changed their residence each decadE.As a consequence, historian David Donald has written, 'Social atomization affected every segment of society,' and it seemed to many people that 'all the recognized values of orderly civilization were gradually being erodeD.'Rapid industrialization and increased geographic mobility in the nineteenth century had special implications for women because these changes tended to magnify social distinctions. As the roles men and women played in society became more rigidly defined, so did the roles they played in the homE.In the context of extreme competitiveness and dizzying social change, the household lost many of its earlier functions and the home came to serve as a haven of tranquility and order. As the size of families decreased, the roles of husband and wife became more clearly differentiated than ever beforE.In the middle class especially, men participated in the productive economy while women ruled the home and served as the custodians of civility and culturE.The intimacy of marriage that was common in earlier periods was rent, and a gulf that at times seemed unbridgeable was created between husbands and wives.What does the passage mainly discuss?A.The economic development of the United States in the eighteenth century.B.Ways in which economic development led to social changes in the United States.C.Population growth in the western United States.D.The increasing availability of industrial jobs for women in the United States.

A.B.'
C.
What
D.The
E.
B.Ways
F.
C.Population
G.
D.The