Search

17. 백준_Python [2530] 인공지능 시계

A, B, C = map(int, input().split()) D = int(input()) print(D // 60) print(D % 60) B += D // 60 C += D % 60 if C >= 60: B += C // 60 C -= 60 if B >= 60: A += B // 60 B = B % 60 if A >= 24: A -= 24 print(A, B, C)
Python
복사
이렇게 풀었는데 틀렸다 ㅎㅎ…ㅜ
A, B = map(int, input().split()) C = int(input()) A += C // 60 B += C % 60 if B >= 60: A += 1 B -= 60 if A >= 24: A -= 24 print(A,B)
Python
복사
A, B, C = map(int, input().split()) D = int(input()) C += D % 60 D = D // 60 if C >= 60: C -= 60 B += 1 B += D % 60 D = D // 60 if B >= 60: B -= 60 A += 1 A += D % 24 if A >= 24: A -= 24 print(A,B,C)
Python
복사
A, B, C = map(int, input().split()) D = int(input()) print(D // 60) print(D % 60) B += D // 60 C += D % 60 if C >= 60: B += C // 60 C -= 60 if B >= 60: A += B // 60 B = B % 60 if A >= 24: A -= 24 print(A, B, C)
Python
복사
어쩌면 내가 처음에 원했던 답이 이거 였던거 같다