※ 글쓴이는 취미로 코딩을 익혀보는 사람이라 정확하지 않은 내용을 담고 있을 수 있다 ※

 

이번에 볼 문제는 백준 26307번 문제인 Correct이다.
문제는 아래 링크를 확인하자.

https://www.acmicpc.net/problem/26307 

 

26307번: Correct

Your best friend, Charlie, participated Taiwan Online Programming Contest (TOPC), which is a preliminary contest of the International Collegiate Programming Contest (ICPC). According to the rules, teams are ranked according to the most problems solved. Tea

www.acmicpc.net

주어지는 시각은 AM 9시로부터 (HH-9)시간 MM분 지난 시각과 같다. 따라서 이 시각은은 AM 9시로부터 (HH-9)*60 + MM분 지난 시각이다.

 

위에서 구한 시간간격을 출력해 문제를 해결하자.

 

아래는 제출한 소스코드이다.

#include <iostream>
using namespace std;

int H, M;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> H >> M;
	cout << (H - 9) * 60 + M;
}
728x90

+ Recent posts