not sure whats wrong with the code.
package com.codegym.task.task05.task0507;
import java.util.*;
/*
Arithmetic mean
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner sc = new Scanner(System.in);
//boolean flag = true;
double count = 0;
double sum = 0;
while(true){
double num = sc.nextDouble();
sum+=num;
count++;
if(num == -1){
//flag = false;
count--;
System.out.println(sum/count);
break;
}
}
}
}