标签:vb.net net val nbsp module .net turn 不能 function
Module Module1 Function AddElements(ByVal arr As Integer()) As Integer Dim sum As Integer = 0 Dim i As Integer Dim length As Integer length = arr.Length For i = 0 To i = 3 //注意地方不能写i=3,否则不会循环,只执行一次 Console.WriteLine(arr(i)) sum += arr(i) Next i Return sum End Function Sub Main() Dim a As Integer = 100 Dim b As Integer = 50 Dim res As Integer Dim arr() As Integer = {4, 2, 11, 22} res = AddElements(arr) Console.WriteLine(res) Console.ReadLine() End Sub End Module
标签:vb.net net val nbsp module .net turn 不能 function
原文地址:https://www.cnblogs.com/fpcbk/p/10750171.html