本文介绍了如何求和数组的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

汇总数组元素并将

值放入另一个变量的语法是什么?请。

What is the syntax for summing the elements of the an array and putting that
value into another varialble? Please.

推荐答案






写一个循环。

-

Armin



Write a loop.
--
Armin





\\\

Dim aint()As Integer = {4,5,7,99}

点心为整数

Dim i As Integer

For Each i in aint

sum = sum + i

Next i

MsgBox( sum.ToString())

///


-

Herfried K. Wagner

MVP·VB Classic,VB.NET




\\\
Dim aint() As Integer = {4, 5, 7, 99}
Dim sum As Integer
Dim i As Integer
For Each i In aint
sum = sum + i
Next i
MsgBox(sum.ToString())
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


这篇关于如何求和数组的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 16:11