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. System.out.println("burmalda");
  13. int carspeed = 130;
  14. int fine20to40 = 500;
  15. int fine40to60 = 1000;
  16. int fine60to80 = 2000;
  17. int fine80plus = 5000;
  18. int townspeed = 60;
  19. int overspeed = carspeed - townspeed;
  20. if(overspeed < 20) {
  21. System.out.println("all good");
  22. }
  23. else if(overspeed >= 20 && overspeed < 40) {
  24. System.out.println("all bad: " + fine20to40);
  25. }
  26. else if(overspeed >= 40 && overspeed < 60) {
  27. System.out.println("all bad: " + fine40to60);
  28. }
  29. else if(overspeed >= 60 && overspeed < 80) {
  30. System.out.println("all bad: " + fine60to80);
  31. }
  32. else if(overspeed >= 80) {
  33. System.out.println("all bad: " + fine80plus);
  34. }
  35. }
  36. }
Success #stdin #stdout 0.11s 55632KB
stdin
wwwq
stdout
burmalda
all bad: 2000