fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.BigDecimal;
  7. import java.math.RoundingMode;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. int result0 = 0;
  15. double result1 = 0;
  16. if ((10 % 2) == 0)
  17. {
  18. result0 = (int)(10d / 2);
  19. System.out.println(result0);
  20. }
  21. if ((10 % 3) != 0)
  22. {
  23. result1 = (10d / 3);
  24. BigDecimal bd = new BigDecimal(result1).setScale(2, RoundingMode.HALF_EVEN);
  25. System.out.println(bd.doubleValue());
  26. }
  27. }
  28. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
5
3.33