+ 1
The snail in the well
function main() { var depth = parseInt(readLine(), 10); //your code goes here for (depth+7-2; depth<=6;i++) { console.log(depth) } } =no ouput
3 Réponses
+ 3
You need to review how to write a for loop, your syntax does not make sense. You never declared the i variable, just try incrementing it in the loop, but in JavaScript it means the value is undefined.
+ 2
function main() {
var depth = parseInt(readLine(), 10);
//your code goes here
var depthCover = 0;
for (day = 1; day<=depth; ++day){
if (depth - depthCover > 7){
depthCover += 5;
}else {
break;
}
}
console.log(day)
}