BOJ/백준-9498-python

cosmos·2021년 1월 17일
4
post-thumbnail

문제📖

풀이🙏

첫째 줄에 시험 점수(range(0,100+1))이 주어지고 점수로 학점을 출력하는 문제이다.

  • 90~100 == A
  • 80~89 == B
  • 70~79 == C
  • 60~69 == D
  • else == F

코드💻

# boj, 9498 : 시험 성적, python3
score = int(input())

if score < 0 or score > 100:
    print("score range error")
else:
    if score >= 90 and score <= 100:
        print("A")
    elif score >= 80 and score <= 89:
        print("B")
    elif score >= 70 and score <= 79:
        print("C")
    elif score >= 60 and score <= 69:
        print("D")
    else:
        print("F")

결과😎

출처📝

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

풀코드

github

2개의 댓글

comment-user-thumbnail
2021년 1월 17일

Very good

답글 달기
comment-user-thumbnail
2021년 1월 17일

Verygood

답글 달기