题目

如果数组a(下标1到n)满足a(1)≤a(2)≤…≤a(i-1)≤a(i)≥a(i+1)≥…≥a(n),则称数组a是单峰的,并称a(i)是数组a的“峰顶”。下列程序段用于查找数组a中的“峰顶”,并返回该“峰顶”值。 Dim a( 1 To 10) As Integer Function Search(L As Integer, R As Integer) As Integer      M=(L+R)\2      If a(M) <a(M-1) And a(M) >a(M+1) Then      ①      ElseIf a(M) >a(M-1) And a(M) >a(M+1) Then      ②      ElseIf a(M) >a(M-1) And a(M) <a(M+1) Then      ③      End If End Function Private Sub Command 1 click()      Label 1.caption=““峰顶”值是:” +Str(Search (1,10)) End Sub 上述程序中划线处可选语句为: ①Search=Search(M+1,R) ②Search=Search(L,M-1) ③Search=a(M) 则①②③处的语句依次是(  ) A . ①②③ B . ①③② C . ③①② D . ②③① 答案:D
信息技术 试题推荐
最近更新