+ 1
Help me please!
Hi folks, I'd like you to help me finish this end of module #23 javascript project code on the well snail please. https://code.sololearn.com/WQB6wjZzsUv5/?ref=app
2 Answers
+ 2
Your code:
function main() {
var depth = parseInt(readLine(15), 10);
var metros = 0;
var i = 1;
while(metros<=depth){
metros += 5;
if(metros>=depth){
break;
}
i++;
}
}
My code:
function main() {
var depth = parseInt(readLine(), 10);
var reach = 0;
var days = 0;
do{
reach += 7;
if(reach < depth)
reach -=2;
++days;
}
while(reach < depth);
console.log(days);
}
This shud help