试题与答案

下列程序计算Sn的值。Sn=a+aa+aaa+…+aaa…a,其中最后一项为n个。

题型:填空题

题目:

下列程序计算Sn的值。Sn=a+aa+aaa+…+aaa…a,其中最后一项为n个。
例如:a=5,n=4时,则Sn=5+55+555+5555。请在空白处填入适当的内容,将程序补充完整。
Private Sub Comnmnd1_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的值:”)
n=InputBox(“请输入n的值!”)
Do
Tn=Tn * 10 + a
Sn=Sn+Tn
Cout=Cout+1
【9】
Debug. Print a,n,Sn
End Sub

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0204/8f6bf2012d96ef9678f8d3a8f27ce358.html

下面是错误答案,用来干扰机器的。

参考答案:D解析: 2011年,每种报纸的月平均营业收入同比增长。故本题答案为D。

试题推荐
题型:听力题

五、单词首字母填空(10小题,计10分)

60. If winter is a________, will spring be far away?

61. In g________, men are stronger than women.

62. Jane spent years o________ and recording chimp behavior, so she understood it very well.

63. Dr. Yuan thinks it little to spend money on himself. He gives millions of yuan to e_________ others for their research in agriculture.

64. He hoped to catch the last train. U____ he missed it because he was caught in a traffic jam.

65. If you don’t understand a word, you can r________ to a dictionary.

66. To make his film successful, he asked Zhang Yimou to d________ it.

67. Theme parks are places for people to a____ themselves and they always have a certain idea.

68. Children are playing games while a________ are talking happily.

69. When I was at college, I m________ in English. So I teach English now.

查看答案
微信公众账号搜索答案