I have run all the answers in Help but still not seing the answer... Maybe some help pls! :)
package com.codegym.task.task05.task0529;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Console-based piggy bank
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
int total = 0;
while (true) {
String s = buffer.readLine();
if (s.equals("exit"))
break;
total = Integer.parseInt(s) + total;
}
System.out.println(total);
}
}