baekjoon 20251207
This commit is contained in:
parent
e6f23b2101
commit
831a6dcace
27
code_study/Baekjoon/c/2530.c
Normal file
27
code_study/Baekjoon/c/2530.c
Normal 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;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user