TEMA

wrong answer in javascript

jvsilva5 preguntado 3 years ago

Hi there. I coded in javascript using % operator. The output for any entries are same with the requested outputs. What may be the problem?

Thanks

Recuerda no enviar soluciones. Tu mensaje puede ser revisado por nuestros moderadores.

  • dudacastro respondido 3 years ago

    I mannaged with this code, try it

    var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var lines = input.split('\n');

    var N = parseInt(lines.shift()); var N2 = N % 3600; var N3 = N2 % 60;

    var horas = parseInt(N / 3600);

    var minutos = parseInt(N2 / 60);

    var segundos = parseInt(N3);

    console.log(horas + ":" + minutos + ":" + segundos);