baekjoon 20251207

This commit is contained in:
songyc macbook 2025-12-07 21:48:46 +09:00
parent e6f23b2101
commit 831a6dcace

View File

@ -0,0 +1,27 @@
#include <stdio.h>
int main() {
int h, m, s, time;
scanf("%d %d %d",&h, &m, &s);
scanf("%d",&time);
h += time / 3600; time %= 3600;
m += time / 60; time %= 60;
s += time;
if (s >= 60) {
m += s/60;
s %= 60;
}
if (m >= 60) {
h += m/60;
m %= 60;
}
if (h >= 24) h %= 24;
printf("%d %d %d\n",h, m, s);
return 0;
}