fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5.  
  6. public class Main
  7. {
  8. private static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
  9.  
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Double a = 0.0;
  13. Double b = 0.0;
  14.  
  15. while(in.nextToken() != StreamTokenizer.TT_EOF){
  16. a = in.nval;
  17. out.print(a + b);
  18. out.print(" ");
  19. b = a;
  20. }
  21. out.flush();
  22. }
  23. }
  24.  
Success #stdin #stdout 0.11s 320576KB
stdin
1 2 3 4 5 6 7
stdout
1.0 3.0 5.0 7.0 9.0 11.0 13.0