Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2884: 알람 시계 #19

Open
minsoo0715 opened this issue Sep 6, 2023 · 0 comments
Open

2884: 알람 시계 #19

minsoo0715 opened this issue Sep 6, 2023 · 0 comments
Assignees
Labels
#수학 수학 문제 @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들

Comments

@minsoo0715
Copy link
Owner

minsoo0715 commented Sep 6, 2023

2884: 알람 시계

소스 코드

아이디어

시간:분을 분 단위로 변경해서 45분을 빼준다. 만약 이때 음수가 된다면 전날이 되는 것이므로 24*60을 더해줌.

구현

m = h*60 + m - 45;
if(m < 0) {
    m += 24*60;
}

cout << m / 60 << ' ' << m % 60;
@minsoo0715 minsoo0715 added @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들 #수학 수학 문제 labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#수학 수학 문제 @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들
Projects
None yet
Development

No branches or pull requests

1 participant