Alguien me dice que está mal de este código?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Alguien me dice que está mal de este código??

Ejercicios caracol en el pozo function main() { var depth = parseInt(readLine(), 10); //tu código va aquí var total; var day; while(total < depth){ day = day + 1; total = total + 7; if(total >= depth){ console.log(day); break; } total = total - 2; } }

9th Feb 2022, 1:59 PM
Pablo Andres Maglione
Pablo Andres Maglione - avatar
2 Answers
+ 2
Inicialice (total) con 0, lo mismo para (día). var total=0; var day=0;
9th Feb 2022, 2:29 PM
Mohammed
+ 1
Que bolu jajaja muchas gracias
10th Feb 2022, 12:32 PM
Pablo Andres Maglione
Pablo Andres Maglione - avatar