Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- c++
- arduino compiler
- LineTracer
- 아두이노 소스
- map
- 아두이노
- 자료구조
- queue
- stl
- 운영체제
- set
- 시스템프로그래밍
- Algorithm
- priority_queue
- Visual Micro
- 컴퓨터 그래픽스
- Stack
- directx
- WinAPI
- html
- Array
- 통계학
- vector
- Deque
- 수광 소자
- list
- C언어
- 아두이노 컴파일러
- 라인트레이서
- Arduino
Archives
- Today
- Total
Kim's Programming
1976. 시각 덧셈 본문
1976. 시각 덧셈
풀이 방법
<코드>
#include<iostream> using namespace std; int main(int argc, char** argv) { std::ios::sync_with_stdio(false); std::cout.tie(nullptr); std::cin.tie(nullptr); int test_case; int T; cin >> T; for (test_case = 1; test_case <= T; ++test_case) { int h1{}, m1{}, h2{}, m2{}; std::cin >> h1 >> m1 >> h2 >> m2; int resulth = h1 + h2; int resultm = m1 + m2; int temp = resultm / 60; resulth += temp; resultm = resultm % 60; if (resulth > 12) resulth -= 12; std::cout << "#" << test_case << " " << resulth << " " << resultm << "\n"; } return 0;//정상종료시 반드시 0을 리턴해야합니다. }
'SW ExpertAcademy > D2' 카테고리의 다른 글
| 1983. 조교의 성적 매기기 (0) | 2018.12.01 |
|---|---|
| 1979. 어디에 단어가 들어갈 수 있을까 (0) | 2018.12.01 |
| 1974. 스도쿠 검증 (0) | 2018.12.01 |
| 1970. 쉬운 거스름돈 (0) | 2018.12.01 |
| 1966. 숫자를 정렬하자 (0) | 2018.12.01 |