Even after looking at the help section at others codes I am quite confused at this and how I should add all the numbers then divide by the total and print it out.
package com.codegym.task.task05.task0507;
/*
Arithmetic mean
*/
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
while(true){
int number = scanner.nextInt();
int count = 0;
if(number == -1)
break;
count++;
int mean = number + number / count;
System.out.println(mean);
}
}
}