fork download
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4.  
  5. class Main
  6. {
  7. public static void main(String args[])
  8. {
  9. Scanner sc=new Scanner(System.in);
  10. float balance,withdraw,cbalance;
  11. withdraw=sc.nextInt();
  12. balance=sc.nextInt();
  13. if(withdraw%5==0)
  14. {
  15. cbalance=(balance-withdraw)-0.50f;
  16. if(cbalance<0)
  17. System.out.format("%.2f%n",balance);
  18. else
  19. System.out.format("%.2f%n",cbalance);
  20. }
  21.  
  22. else
  23. {
  24. System.out.println(balance);
  25. }
  26. }
  27. }
Runtime error #stdin #stdout 0.05s 246144KB
stdin
42 120.00
stdout
Standard output is empty