更多"阅读程序: Function F(a As Integer) "的相关试题:
[单项选择]阅读程序:
Function Fun( a As Integer)
Static c
b=0:b=b+2:c=c+2
F=a*b*c
End Function
Private Sub Commandl _ Click( )
Dim a As Integer
a=2
For i = 1 To 2
Print Fun (
A. ;
[单项选择]阅读程序: Function F(a As Integer) b=0 Static c b=b+1 c=c+1 F=a+b+c End Function Private Sub Command1_Click( ) Dim a As Integer a=2 For i=1 To 3 Print F(a) Next i End Sub 运行上面的程序,单击命令按钮,输出结果为 ______。
A. 4 4 4
B. 4 5 6
C. 4 6 8
D. 4 7 9
[单项选择]阅读程序:
Function fac(ByVal n As Integer)As Integer
Dim temp As Integer
temp=1
For i%=1 To n
temp=temp*i%
Next i%
fac=temp
End Function
Private Sub Form_Click( )
Dim nsum As Integer
nsum=1
For i%=2 To 4
nsum=nsum+fac(i%)
Next i%
Print nsum
End Sub
程序运行后,单击窗体,输出结果是( )。
A. 35
B. 31
C. 33
D. 37
[单项选择]阅读程序: Function F(a As Integer) b=0 Static c b=b+1 c=c+1 f=a+ b+ c End Function Private Sub Command1_Click( ) Dim S As Integer a=2 For i=1 To 3 Print P(A) Next i End Sub运行上面的程序,单击命令拄钮,输出结果为______ 。
A. 4 4 4
B. 4 5 6
C. 4 6 8
D. 4 7 9
[单项选择]有如下一个函数过程:
Function Fun(a As Integer)
Static c
b=0:b=b+1:c=c+1
Fun=a+b+c
End Function
在窗体上添加一个命令按钮,事件过程如下:
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Fun(
A. ;
[单项选择]有如下程序:
Function F(a As Integer)
b = 0
Static c
b = b + 1
c = c + 2
F = a + b + c
End Function
Private Sub Command1_Click( )
Dim a As Integer
a = 2
For i = 1 To 3
Print F
A. ;
[单项选择]阅读程序: Option Base 1 Dim arr( )As Integer Private Sub Form_Click( ) Dim i AsInteger,j As Integer ReDim arr(3,2) For i=1 To 3 Forj=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim Preserve arr(3,4) For j=3 To 4 arr(3,j)=j+9 Nextj Print arr(3,2)+arr(3,4) End Sub 程序运行后,单击窗体,输出结果为
A. 21
B. 13
C. 8
D. 25
[单项选择]阅读程序:
Option Base 1
Dim arr( )As Integer
Private Sub Form_Click( )
Dim i As Integer,j As Integer
ReDim arr(3,2)
For i=1 To 3
For j=1 To 2
arr(i,j)=i*2+j
Next
Next
ReDim Preserve arr(3,4)
For j=3 To 4
arr(3,j)=j+9
Next
Print arr(3,2)+arr(3,4)
End Sub
程序运行后,单击窗体,输出结果为
A. 21
B. 13
C. 8
D. 25
[单项选择]阅读程序:
Option Base 1
Dim arr( ) As Integer
Private Sub Form Click( )
Dim i As Integer,i As Integer
ReDim arr(3,2)
For i=1 To 3
For j=1 To 2
arr(i,j)=i*2+j
Next j
Next i
ReDim arr(3,2)+arr(3,4)
End Sub
程序运行后,单击窗体,输出结果为
A. 21
B. 13
C. 8
D. 25