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("Система расчёта штрафов");
  13.  
  14. int carSpeed = 114;
  15.  
  16. boolean isTown = true;
  17.  
  18. int countrySpeed = 90;
  19.  
  20. int fineFor90to105 = 500;
  21. int fineFor106to120 = 1000;
  22. int fineFor121to135 = 2000;
  23. int fineFor136andMore = 5000;
  24.  
  25. if(carSpeed > countrySpeed);
  26.  
  27. if(carSpeed < 90) {
  28. System.out.println("Скорость не превышена");
  29. }
  30. else if (carSpeed >= 90 && carSpeed <= 105) {
  31. System.out.println("Штраф " + fineFor90to105);
  32. }
  33. else if (carSpeed >= 106 && carSpeed <= 120) {
  34. System.out.println("Штраф " + fineFor106to120);
  35. }
  36. else if (carSpeed >= 121 && carSpeed <= 135) {
  37. System.out.println("Штраф " + fineFor121to135);
  38. }
  39. else if (carSpeed >= 136) {
  40. System.out.println("Штраф " + fineFor136andMore);
  41. }
  42. }
  43. }
Success #stdin #stdout 0.12s 52008KB
stdin
Standard input is empty
stdout
Система расчёта штрафов
Штраф 1000