0
How can i solv the snail in the well in >>>> JavaScript
2 ответов
+ 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;
}
}
}
}