试题

试题 试卷

logo

题型:单选题 题类:模拟题 难易度:普通

浙江省宁波市镇海中学2020届高三6月信息技术考前模拟试卷

有如下程序段

Function Search(m As Integer, pre As Integer) As Integer

Dim i As Integer

If m < 0 Then

Search = 0

ElseIf m = 0 Then

Search = 1

Else

For i = pre To m

Search = Search + Search(m - i, i) Next i

End If

End Function

Private Sub Command1_Click() Dim n As Integer

n = Val(Text1.Text) Label1.Caption = Search(n, 1)

End Sub

若在文本框 Text1 中输入“4”,则标签 Label1 中显示的内容为(  )

A、2 B、4 C、   5 D、7
举一反三
返回首页

试题篮