1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

問題概要

テストの点数に合わせて、BadGoodGreatPerfectの評価を出力せよ。

解法と実装

if文で場合分けして答えを出力できます。

N = int(input()) # 入力の受け取り
if N <= 59: # 59以下
  print("Bad")
elif N <= 89:
  print("Good")
elif N <= 99:
  print("Great")
else:
  print("Perfect")

不等号に等号をつけるかどうかで判定する値が変わるので注意してください。

N = int(input()) # 入力の受け取り
if N < 60: # 60未満
  print("Bad")
elif N < 90:
  print("Good")
elif N < 100:
  print("Great")
else:
  print("Perfect")
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?