回答編集履歴

2

処理順訂正

2019/11/17 05:43

投稿

ironya
ironya

スコア454

test CHANGED
@@ -44,13 +44,13 @@
44
44
 
45
45
  System.out.println(pythagoras);
46
46
 
47
+ count++;
48
+
47
49
  } catch (PythagorasException e) {
48
50
 
49
51
  System.out.println(e.getMessage());
50
52
 
51
53
  }
52
-
53
- count++;
54
54
 
55
55
  }
56
56
 

1

処理順訂正

2019/11/17 05:42

投稿

ironya
ironya

スコア454

test CHANGED
@@ -6,17 +6,17 @@
6
6
 
7
7
  public Pythagoras(int lineA, int lineB, int lineC) throws PythagorasException {
8
8
 
9
+ if (lineA<=0 || lineB<=0 || lineC<=0) {
10
+
11
+ throw new PythagorasException("0以下の数値は判定不可能");
12
+
13
+ }
14
+
9
15
  this.lineA=lineA;
10
16
 
11
17
  this.lineB=lineB;
12
18
 
13
19
  this.lineC=lineC;
14
-
15
- if (lineA<=0 || lineB<=0 || lineC<=0) {
16
-
17
- throw new PythagorasException("0以下の数値は判定不可能");
18
-
19
- }
20
20
 
21
21
  }
22
22