두 숫자의 짝홀 여부
i = input()
j = i.split(" ")
a = int(j[0])
b = int(j[1])
if a % 2 == 0:
print("even")
else:
print("odd")
if b % 2 == 0:
print("even")
else:
print("odd")
특정 조건 두 정수 비교
i = input()
j = i.split(" ")
a = int(j[0])
b = int(j[1])
if a < b:
result1 = "1"
else:
result1 = "0"
if a == b:
result2 = "1"
else:
result2 = "0"
print(result1, result2)
3 또는 5의 배수
a = int(input())
if a % 3 == 0:
print("YES")
else:
print("NO")
if a % 5 == 0:
print("YES")
else:
print("NO")
'코딩테스트 > 프로그래밍 기초 | 조건문' 카테고리의 다른 글
[코드트리] and 기호 (1) | 2024.10.09 |
---|---|
[코드트리] 비교 연산자와 조건문 (1) | 2024.09.25 |
[코드트리] if if 조건문 (1) | 2024.09.10 |
[코드트리] if elif elif else 조건문 (0) | 2024.09.10 |
[코드트리] if elif else 조건문 (1) | 2024.09.02 |