如果存在如下过程:Private Function Fun(a() As Integer)Dim First As Integer, Last As Integer, i As IntegerFirst=LBound(a)Last=UBound(a)Max=a(First)For i=First To LastIf a(i) Max Then Max=a(i)NextFun=MaxEnd Function在窗体上添加一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()ReDim m(1 To 4) As Integerm(1)=20: m(2)=30: m(3)=50: m(4)=100c=Fun(m)Print cEnd Sub单击命令按钮,其输出结果为 【 】。
如果存在如下过程:
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
单击命令按钮,其输出结果为 【 】。
相关考题:
下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及Integer,int类型和String类型之间的转换。请将程序补充完整。程序运行结果如下:123456456public class ex7_1{public static void main(String[]args) {Integer intObj;int n;String s;intObj = new Integer(123);n=intObj.__________;System.out.printin(Integer.toString(n));s=new String("456");intObj=Integer._________;System.out.println(intObj.__________);n=Integer.parseInt(s);System.out.println(Integer.toString(n));}}
如果Add函数的调用代码为:func main() {var a Integer = 1var b Integer = 2var i interface{} = asum := i.(Integer).Add(b)fmt.Println(sum)}则Add函数定义正确的是() A.type Integer intfunc (a Integer) Add(b Integer) Integer { return a + b}B.type Integer intfunc (a Integer) Add(b *Integer) Integer { return a + *b}C.type Integer intfunc (a *Integer) Add(b Integer) Integer { return *a + b}D.type Integer intfunc (a *Integer) Add(b *Integer) Integer { return *a + *b}
15、数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为_____。A.(last- first+M)%MB.last-first+1C.last-first-1D.last-first
数组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;
数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为_____。A.(last- first+M)%MB.last-first+1C.last-first-1D.last-first
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;
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
1、数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为_____。A.(last- first+M)%MB.last-first+1C.last-first-1D.last-first
11、下面哪些定义是类型正确的?A.f :: (Integer, Integer) - Float f (x,y) = x / yB.f :: (Integer, Integer) - Float f (x,y) = (fromInteger x) / (fromInteger y)C.f :: (Integer, Integer) - Float f (x,y) = 3*x + yD.f :: (Integer, Integer) - Integer f (x, y) = 3*x + y