fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.Scanner;
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception {
  8. Scanner scan = new Scanner(System.in);
  9. double sum = 0;
  10. double number = 0;
  11. while(scan.hasNext()){
  12. number=scan.nextInt();
  13. sum+=number;
  14. }
  15. System.out.println(sum);
  16. }
  17. }
Success #stdin #stdout 0.12s 29496KB
stdin
1 2 3
stdout
6.0