Hi! I have a buffer error when I run the code. can someone help me with this?
package com.codegym.task.task05.task0507;
/*
Arithmetic mean
*/
public class Solution {
public static void main(String[] args) throws Exception{
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
double sum=0;
int count =0;
while(true) {
int nr=Integer.parseInt(reader.readLine());
count = count+1;
sum = sum + nr;
if (nr == -1)
{ break;}
}
System.out.println(sum/count);
}
}