Code&Data Insights
BaekJoon Algorithm - Stage 2 [ 1-5 ] ( Python 3 ) 본문
Algorithm/BaekJoon Online Judge
BaekJoon Algorithm - Stage 2 [ 1-5 ] ( Python 3 )
paka_corn 2022. 1. 13. 11:12
2022.01.12
#1 Python - If문
#2 윤년 표시하기
조건 : ( y % 4 == 0 and y % 100 != 0 ) or y % 400 == 0
#3 사분면 고르기
java와 다른점
&& == and
|| == or
--> 그냥 영어로 써도 됨, () 필요 X
#4 알람시계
45분 일찍 알람 설정하기
[my code]
time = input().split(' ')
h = int(time[0])
m = int(time[1])
if 45 <= m <= 60 :
m -= 45
print(h,m)
elif 0 <= m < 45 :
m += 15
h -= 1
if h < 0 :
h += 24
print(h,m)
else :
print(h,m)
'Algorithm > BaekJoon Online Judge' 카테고리의 다른 글
BaekJoon Algorithm - Stage 6[1], Stage 7 [ 1-4 ] ( Python 3 ) (0) | 2022.01.16 |
---|---|
BaekJoon Algorithm - Stage 5 [ 4-7 ] ( Python 3 ) (0) | 2022.01.15 |
BaekJoon Algorithm - Stage 4 [ 1-3 ], Stage 5 [ 1-3 ] ( Python 3 ) (0) | 2022.01.15 |
BaekJoon Algorithm - Stage 3 [ 1-11 ] ( Python 3 ) (0) | 2022.01.15 |
BaekJoon Algorithm - Stage 1 [ 1-11 ] ( Python 3 ) (0) | 2022.01.12 |
Comments