fork(1) download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int timer = 3782;
  6. int hh = 0, mm = 0, ss = 0;
  7.  
  8. hh = timer / 3600;
  9. timer = timer % 3600;
  10. mm = timer / 60;
  11. timer = timer % 60;
  12. ss = timer;
  13.  
  14. printf( "%dh, %dm and %ds.\n", hh, mm, ss );
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 2740KB
stdin
Standard input is empty
stdout
1h, 3m and 2s.