Last active
March 11, 2021 16:31
-
-
Save ram0973/6c448f0777b267a2b1ace372f2eb497a to your computer and use it in GitHub Desktop.
Test sum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task04.task0442; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
public class Solution { | |
public static void main(String[] args) throws Exception { | |
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | |
int sum = 0; | |
int number = 0; | |
while (number != -1) { | |
number = Integer.parseInt(reader.readLine()); | |
sum = sum + number; | |
} | |
System.out.println(sum); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment