首页题目详情

在Visual Basic中,如何定义一个接受两个整数参数并返回它们之和的函数?

题目配图
A.Function Sum(a As Integer, b As Integer) As Integer
B.Sub Sum(a As Integer, b As Integer) As Integer
C.Public Function Sum(a, b) As Integer
D.Function Sum(a As Integer, b) As Integer

优质解答

答案

A

解析

Visual Basic中定义函数时,参数类型需明确指定,使用Function关键字而非Sub,并且明确返回类型为Integer。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

Visual Basic语言程序设计单选题中等AI生成