问题 填空题

下列程序计算Sn的值。Sn=a+aa+aaa+…a,其中最后一项为n个。 例如:a=5,n=4时,则Sn=5+55+555+5555。请在空白处填入适当的内容,将程序补充完整。 Private Sub Command1_Click( ) Dim a As Integer, n As Integer, Cout As Integer Dim Sn As Long, Tn As Long Cout = 1 Sn =0 Tn =0 a = InputBox("请输入a的值:" ) 【9】 DoTn =Tn * 10 + aSn = Sn + TnCout = Cout + 1 【10】 Debug. Print a, n, Sn End Sub

答案

参考答案:[9]答案:n=InputBox(“请输入n的值!”)

解析:[10]Loop While Cout<=n或Loop Until Cout = n + 1[命题目的] 本题考核循环控制结构的应用及阅读程序的能力。[解题要点] a和n的值必须已知,表达式才能计算。但程序中没有给变量n赋值的语句,可见第一个空白行应该填写给n赋值的语句。 Do循环应该有与之对应的终端语句,可见了第二个空白行应填写Do循环的终端语句,即While语句,同时要构造出控制循环的<条件>。程序中有四个赋值语句,其中有一个计数语句Cout=Coat+1,可见控制循环次数的变量应是Cout。

改错题

短文改错(共10小题;每小题1分,满分10分)

此题要求在答题卡上改正所给短文中的错误。对标有题号的每一行做出判断:如无错误,在该行右边横线上划一个勾(√);如有错误(每行只有一个错误),则按下列情况改正:

此行多一个词:把多余的词用斜线(﹨)划掉在该行右边横线上写出该词,并用斜线划掉。此行缺一个词:在缺字处加一个漏字符号(∧),在该行右边横线上写出该加的词。

此行错一个词:在错的词下划一横线,在该行右边横线上写出改正后的词

注意:原行没有错误的不要改。

I am always interesting in traveling. My reasons are                         76._____

quite simple and clear . If anybody is not satisfied to my                  77._____

viewpoint, I shall greatly surprised at his ways of thinking         78._____

In the first place, traveling increase our knowledge.                 79._____

Only by traveling can we see thing outside our hometown.               80.______

In the second place, traveling is good to my health.                          81.______

While traveling, we can breathe to fresh air  ,                                  82.______

take exercise and strengthening our bodies as well .                  83_______

In a word , I sincere hope everybody can grasp                               84.______

the opportunity of traveling and have a good time .                         85.______

单项选择题