试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 算法的基本概念及常用表示方法同步练习
图中空白处理框①和②处应填入的是( )
Private Sub Command1_Click()
Dim a(0 To 5) As Integer
Dim i As Integer ’①
a(0) = 1 '②
For i = 1 To 5
a(i) = 2 * a(i - 1) + 1 '③
Next i
Text1.Text = Str(a(6)) '④
End Sub
For i=1 To 100
For j=i To 100
If j Mod i=0 Then a(j)=a(j)+1
Next j
Text1. Text=Str(a(30))
数组a各元素的初值为0,执行上述程序段后,文本框Text中输出的内容为( )
Dim a(1 To 10) As Integer
a(1)=2: a(2)=18: a(3)=10: a(4)=34: a(5)=16
a(6)=7: a(7)=37: a(8)=6: a(9)=15: a(10)=15
c=0: x=0: t= 1
For i=1 To 10
a(i)=a(i)*t
c=c+a(i)
If c>0 Then x=x+1
t=-t
Text1.Text=Str(x)
则程序运行后Text1中显示( )
s=input("请输入一串整数,以逗号间隔开来:")
t=""
sum=0
for i in ① :
if i!=", ":
②
else:
sum=sum+int(t)
print("该数据序列的和为:",sum)
试题篮