package test;
import java.util.Scanner;
public class TestMyMath {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double []a=new double[6];
for(int i=0;i<6;i++) {
a[i]=input.nextDouble();
}
MyMath mymath1 =new MyMath();
System.out.println("数值和为"+mymath1.sum(a)+"\n平均值为"+mymath1.mean(a));
}
static class MyMath{
public static double sum(double []x) {
double sum=0;
for(int i=0;i<x.length;i++) {
sum=sum+x[i];
}
return sum;
}
public String mean(double[] a) {
double sum=0;
for(int i=0;i<a.length;i++) {
sum=sum+a[i];
}
return "\n平均值为"+sum/a.length;
}
}
public double mean(double []x) {
double sum=0;
for(int i=0;i<x.length;i++) {
sum=sum+x[i];
}
return sum/x.length;
}
}