Advertisement
Spocoman

Voleyball

Feb 16th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function voleyball(input) {
  2.     let year = input[0];
  3.     let p = Number(input[1]);
  4.     let h = Number(input[2]);
  5.    
  6.     let game = ((48 - h) * 3 / 4) + h + p * 2 / 3;
  7.  
  8.     if (year === "leap") {
  9.         game *= 1.15;
  10.     }
  11.    
  12.     console.log(Math.floor(game));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement