@@ -0,0 +1,752 @@
+package com.matao;%0A%0A/**%0A * Created by matao on 2018/9/27.%0A */%0Apublic class Accumulator %7B%0A    private double total;%0A    private int N;%0A%0A    public void addDataValue(double val) %7B%0A        N++;%0A        total += val;%0A    %7D%0A%0A    public double mean() %7B%0A        return total / N;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return %22Mean (%22 + N + %22 values): %22 + String.format(%22%257.5f%22, mean());%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Accumulator accumulator = new Accumulator();%0A        accumulator.addDataValue(1);%0A        accumulator.addDataValue(2);%0A        accumulator.addDataValue(3);%0A        accumulator.addDataValue(4);%0A        accumulator.addDataValue(5);%0A        System.out.println(accumulator.toString());%0A    %7D%0A%7D%0A

add Accumulator