fork download
  1. //A136в Потоковоя обработка
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class StreamLab
  8. {
  9. public static void main (String[] args)
  10. {
  11. Scanner input = new Scanner(System.in);
  12. int n;
  13. double a, sum = 0;
  14. n = input.nextInt();
  15. for(int i = 1; i <= n; i++)
  16. {
  17. a = input.nextDouble();
  18. sum += Math.abs(a);
  19. }
  20. System.out.println(sum);
  21. }
  22. }
Success #stdin #stdout 0.12s 2841600KB
stdin
2
-3.65
-3.11
stdout
6.76