What is the problem in the code ?
package com.codegym.task.task04.task0442;
/*
Adding
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int i = Integer.parseInt(reader.readLine());
int sum = 0;
while(i != 0){
sum = sum + i;
i = Integer.parseInt(reader.readLine());
if(i == -1)
break;
}
System.out.println(sum);
}
}