/****************************************************
* EJERCICIO 302 *
* AUTOR: Th3_Cr0w *
****************************************************/
#include <iostream.h>
#include <stdlib.h>
int main()
{
int tiempo;
int total, horas, minutos, segundos;
cout << endl;
cout << " Introduce el tiempo en segundos: ";
cin >> tiempo;
cout << endl;
total = tiempo;
horas = tiempo/3600;
tiempo -= (horas * 3600);
minutos = tiempo/60;
tiempo -= (minutos * 60);
segundos = tiempo;
cout << " " << total << " segundos equivalen a: " << horas << " horas, ";
cout << minutos << " minutos y " << segundos << " segundos.\n\n\n";
system("PAUSE");
return 0;
}
#include <stdio.h>
#include <windows.h>
int main(void)
{
int iSeg, iMin, iHor, iCapS, iCapM;
printf("Favor digitar el valor de segundos: ");
scanf("%d",&iSeg);
iMin=iSeg/60;
iCapS=iSeg % 60;
iCapM=iMin % 60;
iHor=iMin/60;
printf("La cantidad de segundos es: %d\nhor: %d min: %d seg: %d",iSeg,iHor,iCapM,iCapS);
Sleep(2000);
}