回答編集履歴

1

引数vを削除

2021/08/12 07:11

投稿

xebme
xebme

スコア1090

test CHANGED
@@ -24,9 +24,9 @@
24
24
 
25
25
  public static void main(String[] args) {
26
26
 
27
- for (int i=1;i<10;++i) {
27
+ for (int i = 1; i < 10; ++i) {
28
-
28
+
29
- checkRemainder(i, i, i, "");
29
+ checkRemainder(i, i, /* i, */ "");
30
30
 
31
31
  System.out.println();
32
32
 
@@ -36,7 +36,7 @@
36
36
 
37
37
 
38
38
 
39
- static void checkRemainder(int rem, int divisor, int v, String accum) {
39
+ static void checkRemainder(int rem, int divisor, /* int v,*/ String accum) {
40
40
 
41
41
 
42
42
 
@@ -52,13 +52,13 @@
52
52
 
53
53
  // 余りがある
54
54
 
55
- checkRemainder(rem - divisor, divisor, v, accum + ((accum.length()==0)?"":",") + divisor);
55
+ checkRemainder(rem - divisor, divisor, /* v,*/ accum + ((accum.length()==0)?"":",") + divisor);
56
56
 
57
57
  }
58
58
 
59
- if (rem == v) accum = "";
59
+ /* if (rem == v) accum = ""; */
60
-
60
+
61
- checkRemainder(rem, divisor - 1, v, accum);
61
+ checkRemainder(rem, divisor - 1, /* v,*/ accum);
62
62
 
63
63
 
64
64