回答編集履歴
1
コメントに合わせて修正
test
CHANGED
@@ -2,27 +2,25 @@
|
|
2
2
|
|
3
3
|
```
|
4
4
|
|
5
|
-
public class
|
5
|
+
public class Graph {
|
6
6
|
|
7
|
-
public static void main(String[] args)
|
7
|
+
public static void main(String[] args) {
|
8
8
|
|
9
|
-
|
9
|
+
printGraph(10);
|
10
10
|
|
11
|
-
|
11
|
+
}
|
12
12
|
|
13
|
-
|
13
|
+
|
14
14
|
|
15
|
-
|
15
|
+
private static void printGraph(int x) {
|
16
16
|
|
17
|
-
|
17
|
+
for(int a=-x; a<x+1; a++) {
|
18
18
|
|
19
|
-
System.out.printf("%
|
19
|
+
System.out.printf("%3d:%n", a);
|
20
20
|
|
21
|
+
}
|
21
22
|
|
22
|
-
|
23
|
-
System.out.printf("%4d:%s%n", -10, "テスト1");
|
24
|
-
|
25
|
-
System.out.print
|
23
|
+
System.out.println("");
|
26
24
|
|
27
25
|
}
|
28
26
|
|
@@ -40,20 +38,48 @@
|
|
40
38
|
|
41
39
|
```
|
42
40
|
|
43
|
-
|
41
|
+
-10:
|
44
42
|
|
45
|
-
|
43
|
+
-9:
|
46
44
|
|
47
|
-
|
45
|
+
-8:
|
48
46
|
|
49
|
-
|
47
|
+
-7:
|
50
48
|
|
51
|
-
|
49
|
+
-6:
|
52
50
|
|
53
|
-
|
51
|
+
-5:
|
54
52
|
|
55
|
-
-
|
53
|
+
-4:
|
56
54
|
|
55
|
+
-3:
|
56
|
+
|
57
|
+
-2:
|
58
|
+
|
59
|
+
-1:
|
60
|
+
|
61
|
+
0:
|
62
|
+
|
63
|
+
1:
|
64
|
+
|
65
|
+
2:
|
66
|
+
|
67
|
+
3:
|
68
|
+
|
69
|
+
4:
|
70
|
+
|
71
|
+
5:
|
72
|
+
|
73
|
+
6:
|
74
|
+
|
75
|
+
7:
|
76
|
+
|
57
|
-
|
77
|
+
8:
|
78
|
+
|
79
|
+
9:
|
80
|
+
|
81
|
+
10:
|
82
|
+
|
83
|
+
|
58
84
|
|
59
85
|
```
|