0
PLS WHAT IS WRONG WITH THE CODE
function main() { var depth = parseInt(readLine(), 10); //your code goes here days = 0 feetMovedUpByDay = 7; feetMovedUpByNight = 2; feetMovedTotal = 0 for(feetMovedTotal = 0; feetMovedTotal != depth; feetMovedTotal += 7){ if (feetMovedTotal !== depth) { if (feetMovedTotal + 7 !== depth) { feetMovedTotal += 7 } if (feetMovedTotal -2 !== depth) { feetMovedTotal -= 2 } } days += 1; } console.log(days) }
2 Antworten
+ 4
after for loop in if condition it should ve feetMovedToral != depth instead of !==
0
TNX