점수 비교
https://www.codetree.ai/missions/4/problems/score-comparison?&utm_source=clipboard&utm_medium=text
A = input()
B = input()
a = A.split(" ")
b = B.split(" ")
a_m = int(a[0])
a_e = int(a[1])
b_m = int(b[0])
b_e = int(b[1])
print(int(a_m>b_m and a_e>b_e))
범위 안의 수
https://www.codetree.ai/missions/4/problems/number-in-range?&utm_source=clipboard&utm_medium=text
a = int(input())
if a >= 10 and a <= 20:
print("yes")
else:
print("no")
시력 검사
https://www.codetree.ai/missions/4/problems/eye-test?&utm_source=clipboard&utm_medium=text
l = float(input())
r = float(input())
if l >= 1.0 and r >= 1.0:
print("High")
elif l >= 0.5 and r >= 0.5:
print("Middle")
else:
print("Low")
특정 조건 세 정수 비교
i = input()
j = i.split(" ")
a = int(j[0])
b = int(j[1])
c = int(j[2])
if a<=b and a<=c:
result1 = "1"
else:
result1 = "0"
if a == b and b == c:
result2 = "1"
else:
result2 = "0"
print(result1, result2)
세 정수의 최솟값
i = input()
j = i.split(" ")
a = int(j[0])
b = int(j[1])
c = int(j[2])
if a<=b and a<=c:
print(a)
elif b<=a and b<=c:
print(b)
else:
print(c)
세 수의 중간값
i = input()
j = i.split(" ")
a = int(j[0])
b = int(j[1])
c = int(j[2])
if b>a and b<c:
print("1")
else:
print("0")
'코딩테스트 > 프로그래밍 기초 | 조건문' 카테고리의 다른 글
[코드트리] and, or 혼합 (0) | 2024.10.30 |
---|---|
[코드트리] or 기호 (0) | 2024.10.10 |
[코드트리] 비교 연산자와 조건문 (1) | 2024.09.25 |
[코드트리] if else if else 조건문 (0) | 2024.09.25 |
[코드트리] if if 조건문 (0) | 2024.09.10 |