public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
boolean isExit = false;
while(true)
{
String s = reader.readLine();
if(s.equals("sum"))
{
System.out.println(sum);
return;
}
}
}
}
package com.codegym.task.task05.task0529;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Console piggy bank
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
boolean isExit = false;
while(true)
{
String s = reader.readLine();
if(s.equals("sum"))
{
System.out.println(sum);
return;
}
}
}
}