teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

満点の出力変更

2020/02/19 08:23

投稿

退会済みユーザー
answer CHANGED
@@ -10,10 +10,11 @@
10
10
 
11
11
  if( score > 100 ){
12
12
  throw new IllegalArgumentException("範囲外(+)");
13
- } else if( score == 100 ){
14
- System.out.println("「満点だったので宿題免除です!!」");
15
13
  } else if( score >= 80 ){
16
14
  System.out.println("「優秀です!」");
15
+ if( score == 100 ){
16
+ System.out.println("「満点だったので宿題免除です!!」");
17
+ }
17
18
  } else if( score >= 60 ){
18
19
  System.out.println("「普通です!」");
19
20
  } else if( score >= 0 ){
@@ -21,6 +22,7 @@
21
22
  } else {
22
23
  throw new IllegalArgumentException("範囲外(-)");
23
24
  }
25
+
24
26
  } catch (Exception e) {
25
27
  System.err.println("「不正な点数です!」");
26
28
  }