[PS] 구현: 9498 시험 성적

devhans·2024년 8월 27일
0

PS

목록 보기
9/20
post-thumbnail

문제 출처

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

포인트

파이썬에서는 case문이 존재하지 않는다.
대신 if-elif-else문을 권장한다.

코드

import sys

fast_input = sys.stdin.readline
fast_output = sys.stdout.write

score = int(fast_input().rstrip())

if score >= 90:
    fast_output("A")
elif score >= 80:
    fast_output("B")
elif score >= 70:
    fast_output("C")
elif score >= 60:
    fast_output("D")
else:
    fast_output("F")
profile
책 읽고 운동하기

0개의 댓글