Advertisement
Chudo6

Babeeva Julia-30.04.22-Км/день-2

Apr 30th, 2022 (edited)
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //https://shpp.gitbook.io/zero/tutorials/if-else/km-day-2
  2.  
  3. let run = +prompt("Скільки ти проходиш в день?");
  4. //частина 1
  5. if (run <= 3) {
  6.     console.log("Мало");
  7. }
  8. if (run >= 4 && run < 20) {
  9.     console.log("Краcунчик");
  10. }
  11. if (run >= 20) {
  12.     console.log("Марафонець");
  13. }
  14. //частина 2
  15. if (run <= 3) {
  16.     console.log("Мало");
  17. } else if (run >= 4) {
  18.     if (run < 20) {
  19.         console.log("Краунчик");
  20.     } else {
  21.         console.log("Марафонець");
  22.     }
  23. }
  24. //частина 3
  25. if (run <= 3) {
  26.     console.log("Мало");
  27. }
  28. if (run >= 4) {
  29.     if (run < 20) {
  30.         console.log("Краcунчик")
  31.     }
  32. }
  33. if (run >= 20) {
  34.     console.log("Марафонець")
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement