Spocoman

Mining Rig

Feb 27th, 2022 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function miningRig(input) {
  2.     let videosPrice = Number(input[0]) * 13;
  3.     let cablesPrice = Number(input[1]) * 13;
  4.     let powerPerDay = Number(input[2]) * 13;
  5.     let profitPerDay = Number(input[3]) * 13;
  6.  
  7.     let computerPrice = videosPrice + cablesPrice + 1000;
  8.  
  9.     console.log(computerPrice);
  10.     console.log(Math.ceil(computerPrice / (profitPerDay - powerPerDay)));
  11. }
  12.  
  13. Тарикатско решение:)
  14.  
  15. function miningRig(input) {  
  16.     let computerPrice = (Number(input[0]) + Number(input[1])) * 13 + 1000;
  17.     console.log(`${computerPrice}\n${Math.ceil(computerPrice / (Number(input[3]) * 13 - Number(input[2]) * 13))}`);
  18. }
Add Comment
Please, Sign In to add comment