diff --git a/code_study/Baekjoon/c/2530.c b/code_study/Baekjoon/c/2530.c new file mode 100644 index 0000000..b3f3bd2 --- /dev/null +++ b/code_study/Baekjoon/c/2530.c @@ -0,0 +1,27 @@ +#include + +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; +} \ No newline at end of file