fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Depo
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. double n, a;
  10. Scanner in = new Scanner(System.in);
  11. n=in.nextDouble();
  12. for(int i=1; i <=n; i++){
  13. a=in.nextDouble();
  14. if(i%2 != 0){
  15. a*=-1;
  16. }
  17. System.out.println(a);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.16s 321280KB
stdin
4 3 -2 -3 6
stdout
-3.0
-2.0
3.0
6.0