Advertisement
nateshoffner

Untitled

Jul 24th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  1. void split_time(long total_sec, int *hr, int *min, int *sec) {
  2.     *sec = total_sec;
  3.     for(*hr = 0; *sec > 3600; ++*hr, *sec -= 3600){}
  4.     for(*min = 0; *sec > 60; ++*min, *sec -= 60){}
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement