单选题
VB
题号 #2272666
下面程序计算并输出的是( )。
Private Sub Command1 Click( )
a=10
s=0
Do
s=s+a*a*a
a=a-1
Loop Until a<=0
Print s
End Sub
参考答案
A
答案解析
A。【解析】本题中s=s+a*a*a,即求a3。a=a-1即把每次a减1,直到a<=0退出循环,所以本题是求所有的a3之和,所以A选项正确。
你可能感兴趣的试题
A.Print arr.Code(2),art.Caption(2)
B.Print art.Code,arr.Caption
C.Print arr(2).Code,arr(2).Caption
D.Print Code(2),Caption(2)
A.把CD1.Action=1改为CD1.Action=2
B.把“CD1.Filter=”,后面字符串中的“所有文件”改为“文本文件”
C.在语句CD1.Action=1的前面添加:CD1.FilterIndex=3
D.把CD1.FileName=""改为CD1.FileName=”文本文件”
