Baekjoon
[Baekjoon] 단계별로 풀어보기 2. 조건문 with Python
PSLeon
2023. 4. 28. 00:09
반응형
1330
a, b = map(int, input().split())
if a > b:
print('>')
elif a < b:
print('<')
else:
print('==')
9498
def judge_score(score):
if score >= 90:
return 'A'
elif score >= 80:
return 'B'
elif score >= 70:
return 'C'
elif score >= 60:
return 'D'
else:
return 'F'
score = int(input())
print(judge_score(score))
2753
def leap_year(year):
if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
return 1
else:
return 0
year = int(input())
print(leap_year(year))
14681
def quadrant(x, y):
if x > 0 and y > 0:
return 1
elif x < 0 and y > 0:
return 2
elif x < 0 and y < 0:
return 3
else:
return 4
x = int(input())
y = int(input())
print(quadrant(x, y))
2884
H, M = map(int, input().split())
if H <= 0:
if M >= 45:
M -= 45
elif M < 45:
H = 23
M += 15
else:
if M >= 45:
M -= 45
elif M < 45:
H -= 1
M += 15
print(H, M)
2525 (시간 분이 60넘어갈 때와, 시가 24 넘어갈 때 생각)
H, M = map(int, input().split())
needs_time = int(input())
H += needs_time // 60
M += needs_time % 60
if M >= 60:
M -= 60
H += 1
if H >= 24:
H -= 24
print(H, M)
2480
def dice(a, b, c):
if a == b and b == c:
return 10000 + a*1000
elif (a == b and b != c) or (a == c and a != b):
return 1000 + a*100
elif b == c and a != c:
return 1000 + b*100
else:
return max(a, b, c) * 100
a, b, c = map(int, input().split())
print(dice(a, b, c))