시간이 그렇게 큰게 아니여서 걍 반복문으로 처리함
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
/** | |
* https://www.acmicpc.net/problem/2525 | |
* BOJ 백준온라인져지 2525 오븐 시계 풀이 | |
*/ | |
int main(){ | |
int hour, minute; | |
scanf("%d%d", &hour, &minute); | |
int time; | |
scanf("%d", &time); | |
while(time--){ | |
minute++; | |
if(minute == 60){ | |
hour++; | |
if(hour == 24){ | |
hour = 0; | |
} | |
minute = 0; | |
} | |
} | |
printf("%d %d", hour, minute); | |
} |
'IT > 알고리즘' 카테고리의 다른 글
BOJ 백준온라인져지 14921 용액 합성하기 풀이 (0) | 2017.12.14 |
---|---|
BOJ 백준온라인져지 2530 인공지능 시계 풀이 (0) | 2017.12.14 |
BOJ 백준온라인져지 9987 포켓몬 마스터 풀이 (0) | 2017.12.14 |
BOJ 백준온라인져지 14919 분포표 만들기 풀이 (0) | 2017.12.13 |
BOJ 백준온라인져지 14918 더하기 풀이 (0) | 2017.12.13 |