/**时 代 J a v a - nowjava.com**/
//package com.nowjava;
public class Main {
public static void main(String[] argv) throws Exception {
double[] v = new double[] { 34.45, 35.45, 36.67, 37.78, 37.0000,
37.1234, 67.2344, 68.34534, 69.87700 };
System.out.println(mass(v));
}
/**
* Returns the sum of the elements of the array.
*/
public static double mass(double[] v) {
double somme = 0.0;// 来自 N o w J a v a . c o m - 时 代 Java
for (int k = 0; k < v.length; k++) {
somme += v[k];
}
return (somme);
}
/**
* Returns the sum of the elements of the array.
*/
public static int mass(int[] v) {
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。