import java.util.Scanner; class SumTall { public static void main(String[] args) { Scanner s = new Scanner(System.in); int sum = 0; while (true) { int num = s.nextInt(); //Exit the loop if the user inputs 0 if (num == 0) break; sum += num; } //After the user input 0, show them the sum of all their inputs System.out.println("Sum: "+sum); } }