46. 執行下列 Visual Basic 程式碼片段後,請問變數 data ( 1 ), num1, num2 的值依序是多少?
Module Module1
 Sub Main()
 REM 程式由此開始執行
 Dim data() As Integer = {1, 3, 5, 7, 9}
 Dim num1, num2 As Integer
 num1 = data.Length
 num2 = data(4)
 num2 = Processing(data, num1)
 End Sub
 Function Processing(ByRef data() As Integer, ByVal num1 As Integer)
 data(1) = data(1) ^ 2
 num1 = data(3)
 Processing = (num1 + data(1))
 End Function
End Module
(A) 1 , 5 , 6
(B) 9 , 7 , 9
(C) 9 , 5, 16
(D) 3 , 7 , 16

答案:登入後查看
統計: A(111), B(185), C(359), D(105), E(0) #660835

詳解 (共 4 筆)

#2531646
byref值會變  byval不會  這...
(共 233 字,隱藏中)
前往觀看
2
0
#1030721
求解
1
0
#1005250
為毛
1
0
#1042299
byref 傳址 byval傳質
0
0