Skip to content

Instantly share code, notes, and snippets.

@erickguan
Created January 16, 2013 05:46
Show Gist options
  • Select an option

  • Save erickguan/4544959 to your computer and use it in GitHub Desktop.

Select an option

Save erickguan/4544959 to your computer and use it in GitHub Desktop.
c
#include <stdio.h>
int main(void)
{
int h, m, s;
int t_h, t_m, t_s;
int i, n;
while (scanf("%d", &n) != EOF)
for (i = 0; i < n; ++i) {
scanf("%d%d%d%d%d%d",
&h, &m, &s,
&t_h, &t_m, &t_s);
h += t_h;
m += t_m;
s += t_s;
m += s / 60;
s %= 60;
h += m / 60;
m %= 60;
printf("%d %d %d\n", h, m, s);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment