문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PttaaAZIDFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, a[2], b[2], c[2], carry;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        carry = 0;
 
        cin >> a[0>> a[1>> b[0>> b[1];
        c[1= a[1+ b[1];
        if(c[1> 59) {
            carry = 1;
            c[1-= 60;
        }
        c[0= a[0+ b[0+ carry;
        if(c[0> 12) {
            c[0-= 12;
        }
 
        cout << "#" << t_case+1 << " " << c[0<< " " << c[1<< "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1970 - 쉬운 거스름돈  (0) 2018.04.28
SWEA 1974 - 스도쿠 검증  (0) 2018.04.28
SWEA 1545 - 거꾸로 출력해 보아요  (0) 2018.04.27
SWEA 2019 - 더블더블  (0) 2018.04.27
SWEA 1936 - 1대1 가위바위보  (0) 2018.04.27

+ Recent posts