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

在窗体上绘制一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Commandl_Click() Dim c As Integer,d As Integer d=0 c=6 x=Array(2,4,6,8,10,12) For i=1 To 6 If x(i)>c Then d=d+x(i) c=x(i) Else d=d-c End If Next i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输出的内容为
D.20

A.10
B.16
C.12

【参考答案】

C
解析:本题属于综合性题目,考查知识点较多,难度较大。首先程序包含了一个循环结构,同时循环结构中还嵌套有一个条件结构。循环体内部将数组中的元素与c做比较,如果大于c,则与d求和,并将结果赋给d,将该元素赋给c。否则执行d=d-c。最后的运行结果是12,选项C正确。
热门试题

未分类题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

未分类题Deep inside a mountain near Sweatwater in East Tennessee is a body of water known as the Lost SeA.It is listed by the 'Guinness Book of World Records' as the world's largest underground lakE.The lost Sea is part of an extensive and historical cave system called Craighead Caverns.The caverns have been known and used since the days of the Cherokee Indian Nation. The cave expands into a series of huge rooms from a small opening on the side of the mountain. Approximately one mile from the entrance, in a room called 'the Council Room', many Indian artifacts have been founD.Some of the items discovered include pottery, arrowheads, weapons and jewelry.For many years there were persistent rumors of a large underground lake somewhere in a cave, but it was not discovered until 1905. In that year, a thirteen-year-old boy named Ben Sands crawled through a small opening three hundred feet undergrounD.He found himself in a large cave half filled with water.Today tourists visit the Lost Sea and ride far out onto it in glass-bottomed boats powered by electric motors. More than thirteen acres of water have been mapped out so far and still no end to the lake has been founD.Even though teams of divers have tried to explore the Lost Sea, the full extent of it is still unknown.According to the passage, the lost Sea is unique because it is ______.A.part of a historical cave systemB.the biggest underground lake in the worldC.listed in the 'Guinness Book of World Records'D.the largest body of water in Tennessee

A.B.
C.
D.
According
E.
A.part
F.the
G.listed
H.the