SWLUG/λ°±μ€€ BEAKJOON

[python/파이썬] λ°±μ€€ BEAKJOON 2754번: 학점 계산

waterproof 2023. 5. 17. 06:18

[python/파이썬] λ°±μ€€ BEAKJOON 2754번: ν•™μ  κ³„μ‚°

https://www.acmicpc.net/problem/2754

 

2754번: 학점계산

μ–΄λ–€ μ‚¬λžŒμ˜ Cμ–Έμ–΄ 성적이 μ£Όμ–΄μ‘Œμ„ λ•Œ, 평점은 λͺ‡ 점인지 좜λ ₯ν•˜λŠ” ν”„λ‘œκ·Έλž¨μ„ μž‘μ„±ν•˜μ‹œμ˜€. A+: 4.3, A0: 4.0, A-: 3.7 B+: 3.3, B0: 3.0, B-: 2.7 C+: 2.3, C0: 2.0, C-: 1.7 D+: 1.3, D0: 1.0, D-: 0.7 F: 0.0

www.acmicpc.net

 

 

 

1. 문제

 

2. μ •λ‹΅ 및 풀이

 

score = input()

if score == "A+": print(4.3)
elif score == "A0": print(4.0)
elif score == "A-": print(3.7)
elif score == "B+": print(3.3)
elif score == "B0": print(3.0)
elif score == "B-": print(2.7)
elif score == "C+": print(2.3)
elif score == "C0": print(2.0)
elif score == "C-": print(1.7)
elif score == "D+": print(1.3)
elif score == "D0": print(1.0)
elif score == "D-": print(0.7)
elif score == "F": print(0.0)

 

제좜 결과

 

이 외에도 λ”•μ…”λ„ˆλ¦¬λ₯Ό μ΄μš©ν•œ μ½”λ“œκ°€ μžˆλ‹€κ³  ν•œλ‹€.