Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/09/2014, 18:39
ecfisa
 
Fecha de Ingreso: julio-2012
Mensajes: 133
Antigüedad: 11 años, 11 meses
Puntos: 22
Respuesta: Pasar de segundos a horas,minutos y segundos correspondientes.

Hola anggiebs.

Ese cáculo lo podes realizar con operaciones básicas sin necesidad de usar ciclos:
Código C++:
Ver original
  1. void segsToHMS(const unsigned int sgs, int& h, int& m, int& s) {
  2.   h = sgs / 3600;
  3.   m = sgs / 3600 % 60;
  4.   s = sgs % 3600 % 60;
  5. }

Saludos.