Hueestory

[2884] 알람 시계 (C++) 본문

PS(중단)/BOJ

[2884] 알람 시계 (C++)

히명 2024. 4. 26. 00:00
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int h, m; cin >> h >> m;

	if (m < 45) {
		h--;
		m += 15;
	}
	else
		m -= 45;

	if (h < 0)
		h += 24;

	cout << h << " " << m << endl;

	return 0;
}

 

'PS(중단) > BOJ' 카테고리의 다른 글

[10989] 수 정렬하기 3 (C++)  (0) 2024.05.01
[2751] 수 정렬하기 2 (C++)  (1) 2024.04.26
[2753] 윤년 (C++)  (0) 2024.04.25
[2741] N 찍기 (C++)  (0) 2024.04.25
[2739] 구구단 (C++)  (0) 2024.04.25
Comments