Advertisement
-Annie-

EXAM-01.SpiceMustFlow

Jun 13th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(input) {
  2.     startingYield = Number(input);
  3.     let days = 0;
  4.     let total = 0;
  5.  
  6.     while(startingYield >= 100) {
  7.         total += startingYield - 26;
  8.         startingYield -= 10;
  9.         days++;
  10.     }
  11.  
  12.     if(total >= 26) {
  13.         total -= 26;
  14.     }
  15.  
  16.     console.log(days);
  17.     console.log(total);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement