回答編集履歴

3

Toが余計

2019/11/06 08:22

投稿

swordone
swordone

スコア20669

test CHANGED
@@ -30,9 +30,9 @@
30
30
 
31
31
  if(BigDecimal.ZERO.compareTo(p) <= 0 && q.compareTo(BigDecimal.valueOf(100)) <= 0){
32
32
 
33
- BigDecimal s = m.subtract(p.movePointToLeft(2));
33
+ BigDecimal s = m.subtract(p.movePointLeft(2));
34
34
 
35
- BigDecimal ss = s.multiply(q.movePointToLeft(2));
35
+ BigDecimal ss = s.multiply(q.movePointLeft(2));
36
36
 
37
37
  BigDecimal sss = s.subtract(ss);
38
38
 

2

if文もう一箇所あったわ

2019/11/06 08:22

投稿

swordone
swordone

スコア20669

test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  if(BigDecimal.ONE.compareTo(m) <= 0 && m.compareTo(BigDecimal.valueOf(1000)) <= 0){
30
30
 
31
- if(0 <= p && q <= 100){
31
+ if(BigDecimal.ZERO.compareTo(p) <= 0 && q.compareTo(BigDecimal.valueOf(100)) <= 0){
32
32
 
33
33
  BigDecimal s = m.subtract(p.movePointToLeft(2));
34
34
 

1

if文がそのままだったので修正

2019/11/06 07:41

投稿

swordone
swordone

スコア20669

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- if(1 <= m && m<= 1000){
29
+ if(BigDecimal.ONE.compareTo(m) <= 0 && m.compareTo(BigDecimal.valueOf(1000)) <= 0){
30
30
 
31
31
  if(0 <= p && q <= 100){
32
32