# 6065 : 짝수만 순서대로 줄을 바꿔 출력
n1, n2, n3 = input().split()
n1 = int(n1)
n2 = int(n2)
n3 = int(n3)
if n1 % 2 == 0:
print(n1)
if n2 % 2 == 0:
print(n2)
if n3 % 2 == 0:
print(n3)
# 6066 : 입력된 순서대로 짝(even)/홀(odd)을 줄을 바꿔 출력
n1, n2, n3 = input().split()
n1 = int(n1)
n2 = int(n2)
n3 = int(n3)
if n1 % 2 == 0:
print("even")
else:
print("odd")
if n2 % 2 == 0:
print("even")
else:
print("odd")
if n3 % 2 == 0:
print("even")
else:
print("odd")
# 6067 : 음수, 짝수이면 A | 음수, 홀수이면 B | 양수, 짝수이면 C | 양수, 홀수이면 D를 출력
n = int(input())
if n < 0:
if n % 2 == 0:
print("A")
else:
print("B")
else:
if n % 2 == 0:
print("C")
else:
print("D")
# 6068 : 평가 결과를 출력
score = int(input())
if score <= 100 and score >= 90:
print("A")
elif score <= 89 and score >= 70:
print("B")
elif score <= 69 and score >= 40:
print("C")
elif score <= 39 and score >= 0:
print("D")
↓ 다른 정답 코드
score = int(input())
if score >= 90:
print("A")
elif score >= 70:
print("B")
elif score >= 40:
print("C")
else:
print("D")
# 6069 : 문자에 따라 다른 내용이 출력
ch = input()
if ch=='A':
print("best!!!")
elif ch=='B':
print("good!!")
elif ch=='C':
print("run!")
elif ch=='D':
print("slowly~")
else:
print("what?")
# 6070 : 계절 이름을 출력
month = int(input())
if month == 12 or month == 1 or month == 2:
print("winter")
elif month == 3 or month == 4 or month == 5:
print("spring")
elif month == 6 or month == 7 or month == 8:
print("summer")
elif month == 9 or month == 10 or month == 11:
print("fall")
// else는 생략 가능
CodeUp
☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks DEV C++ ☆ 추천 온라인 IDE : C C++11 Python3 Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면
codeup.kr
'CodeUp > Python' 카테고리의 다른 글
[CodeUp] 6077-6087 (Python) (0) | 2022.11.13 |
---|---|
[CodeUp] 6071-6076 (Python) (0) | 2022.11.12 |
[CodeUp] 6063-6064 (Python) (0) | 2022.11.10 |
[CodeUp] 6059-6062 (Python) (0) | 2022.11.09 |
[CodeUp] 6052-6058 (Python) (0) | 2022.11.08 |