- 基础理论
- 数据及数据库技术
- 人工智能
- 算法理论
- + 过程和自定义函数
- 枚举算法及程序实现
- 解析算法及程序实现
- 递归算法及程序实现
- 排序算法及程序实现
- 查找算法及程序实现
- 多媒体理论
- 基础软件操作
- 算法软件操作
- 多媒体软件操作
- 网络技术应用
有如下通用过程和事件过程,运行程序后,单击窗体,程序的运行结果是( )
public function ss(x as integer,y as integer) as integer
if x>y then ss=x-y else ss=y-x
END FUNCTION
PRIVATE SUB FORM CLICK( )
DIM A AS INTEGER ,B AS INTEGER
A=8: B=6
PRINT SS(A,B)
END SUB
public function ss(x as integer,y as integer) as integer
if x>y then ss=x-y else ss=y-x
END FUNCTION
PRIVATE SUB FORM CLICK( )
DIM A AS INTEGER ,B AS INTEGER
A=8: B=6
PRINT SS(A,B)
END SUB
A.2 | B.-2 | C.8 8 | D.6 6 |
在参数传递过程中,使用关键字( )来修饰形式参数,可以使之按值传递。
A.ByVal | B.ByRef | C.Value | D.Reference |
下面VB程序段运行后,文本框Text1和Label1显示的内容分别是( )
Private Sub Command1_Click()
Dim y As Long
Text1.Text = ""
y = f(3)
Label1.Caption = Str(y)
End Sub
Function f(n As Integer) As Long
Text1.Text = Text1.Text + Str(n)
If n <= 1 Then
f = 1
Else
f = f(n - 1) + 2
End If
End Function
Private Sub Command1_Click()
Dim y As Long
Text1.Text = ""
y = f(3)
Label1.Caption = Str(y)
End Sub
Function f(n As Integer) As Long
Text1.Text = Text1.Text + Str(n)
If n <= 1 Then
f = 1
Else
f = f(n - 1) + 2
End If
End Function
A.3 2 1 和 5 | B.1 2 3 和 5 |
C.5 和 3 2 1 | D.6 和 3 2 1 |