题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 递归算法练习
Function f(i As Integer)
If i=1 Then
f=2
Else
f=2 * 10 ^ (i-1)+f(i-1)
End If
End Function
Private Sub Command1_Click()
Dim n As Integer, s As Integer, i As Integer
n=Val(Text1.Text)
s=0
For i=1 To n
s=s+f(i)
Next i
Label1.Caption=Str(s)
End Sub
若在Text1中输入5,则Label1显示的内容为( )
试题篮