如果存在如下过程:
Private Function Fun(a() As Integer)
Dim First As Integer, Last As Integer, i As Integer
First=LBound(a)
Last=UBound(a)
Max=a(First)
For i=First To Last
If a(i) > Max Then Max=a(i)
Next
Fun=Max
End Function
在窗体上添加一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click()
ReDim m(1 To 4) As Integer
m(1)=20: m(2)=30: m(3)=50: m(4)=100
c=Fun(m)
Print c
End Sub
单击命令按钮,其输出结果为 【 】。
第1题:
数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为_____。
A.(last- first+M)%M
B.last-first+1
C.last-first-1
D.last-first
第2题:
8、下面哪些是将分数化为浮点数的正确定义?
A.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = a/b###SXB###B.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = (fromInteger a)/ (fromInteger b)###SXB###C.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = fromInteger (a/b)###SXB###D.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = (fromIntegral a)/ (fromIntegral b)###SXB###E.ty第3题:
11、下面哪些定义是类型正确的?
A.f :: (Integer, Integer) -> Float f (x,y) = x / y
B.f :: (Integer, Integer) -> Float f (x,y) = (fromInteger x) / (fromInteger y)
C.f :: (Integer, Integer) -> Float f (x,y) = 3*x + y
D.f :: (Integer, Integer) -> Integer f (x, y) = 3*x + y
第4题:
11、数组q[M]存储一个循环队,first和last分别是首尾指针。如果使元素x出队操作的语句为“first=(first+1)%m, x=q[first];”。那么元素x进队的语句是_____。
A.last=(last+1)%m,q[last]=x;
B.x=q[last], last =(last+1)%m;
C.q[last+1]=x;
D.q[(last+1)%m]=x;
第5题:
1、数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为_____。
A.(last- first+M)%M
B.last-first+1
C.last-first-1
D.last-first