0
How can i solv the snail in the well in >>>> JavaScript
2 Answers
+ 1
+ 2
function main() {
var depth = parseInt(readLine(), 10);
//tu cĂłdigo va aquĂ
var d = 0; // dĂas
var c = 0; // caracol
while (c < depth) {
c += 7 - 2;
d += 1;
if (c > depth) {
if (c - 2 <= depth) {
console.log(d);
break;
}
else if (c > depth) {
console.log(d - 1);
break;
}
}
}
}