fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. /* test 1 */
  13. double left1 = 0.65;
  14. int foo1 = 0;
  15.  
  16. while (left1 > 0.0d) {
  17. left1 -= 0.05d;
  18. foo1++;
  19. }
  20.  
  21. System.out.println(foo1);
  22.  
  23. /* test 2 */
  24.  
  25. double left2 = 0.7;
  26. int foo2 = 0;
  27.  
  28. while (left2 > 0.0d) {
  29. left2 -= 0.05d;
  30. foo2++;
  31. }
  32.  
  33. System.out.println(foo2);
  34. }
  35. }
Success #stdin #stdout 0.09s 320320KB
stdin
Standard input is empty
stdout
14
14