質問編集履歴

4

書式の改善

2018/11/15 04:44

投稿

MS7789
MS7789

スコア13

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,8 @@
54
54
 
55
55
  public class loop {
56
56
 
57
+
58
+
57
59
  public static void main(String args[]) {
58
60
 
59
61
  EasyReader console = new EasyReader();
@@ -64,37 +66,35 @@
64
66
 
65
67
  String name = console.readLine();
66
68
 
67
-
68
-
69
69
  System.out.print("回数: ");
70
70
 
71
71
  int number = console.readInt();
72
72
 
73
73
 
74
74
 
75
- for (int i = 1; i <= number; i++){
75
+ for (int i = 1; i <= number; i++) {
76
76
 
77
-          for (int j = 1; j <= i -1; j++){
77
+ for (int j = 1; j <= i - 1; j++) {
78
78
 
79
- System.out.print(" ")
79
+ System.out.print(" ");
80
80
 
81
- }
81
+ }
82
82
 
83
-       System.out.print(name);
83
+ System.out.println(name);
84
84
 
85
85
 
86
86
 
87
+ for (int j = 28; j >= i - 1; j--) {
88
+
87
- //この間にコードを書く
89
+ System.out.print(" ");
90
+
91
+ }
92
+
93
+ System.out.println("name");
88
94
 
89
95
 
90
96
 
91
- for (int j = 28; j >= i - 1; j--){
92
-
93
- System.out.print(" ");
94
-
95
- }
97
+ }
96
-
97
- System.out.print(name);
98
98
 
99
99
  }
100
100
 

3

書式の改善

2018/11/15 04:44

投稿

MS7789
MS7789

スコア13

test CHANGED
File without changes
test CHANGED
@@ -54,49 +54,49 @@
54
54
 
55
55
  public class loop {
56
56
 
57
-    public static void main(String args[]) {
57
+ public static void main(String args[]) {
58
58
 
59
-       EasyReader console = new EasyReader();
59
+ EasyReader console = new EasyReader();
60
60
 
61
61
 
62
62
 
63
-       System.out.print("名前: ");
63
+ System.out.print("名前: ");
64
64
 
65
-       String name = console.readLine();
65
+ String name = console.readLine();
66
66
 
67
67
 
68
68
 
69
-       System.out.print("回数: ");
69
+ System.out.print("回数: ");
70
70
 
71
-       int number = console.readInt();
71
+ int number = console.readInt();
72
72
 
73
73
 
74
74
 
75
-       for (int i = 1; i <= number; i++){
75
+ for (int i = 1; i <= number; i++){
76
76
 
77
77
           for (int j = 1; j <= i -1; j++){
78
78
 
79
-             System.out.print(" ")
79
+ System.out.print(" ")
80
80
 
81
-       }
81
+ }
82
82
 
83
83
        System.out.print(name);
84
84
 
85
85
 
86
86
 
87
-       //この間にコードを書く
87
+ //この間にコードを書く
88
88
 
89
89
 
90
90
 
91
-          for (int j = 28; j >= i - 1; j--){
91
+ for (int j = 28; j >= i - 1; j--){
92
92
 
93
-             System.out.print(" ");
93
+ System.out.print(" ");
94
94
 
95
-       }
95
+ }
96
96
 
97
-       System.out.print(name);
97
+ System.out.print(name);
98
98
 
99
-    }
99
+ }
100
100
 
101
101
  }
102
102
 

2

書式の改善

2018/11/15 04:27

投稿

MS7789
MS7789

スコア13

test CHANGED
File without changes
test CHANGED
@@ -54,43 +54,49 @@
54
54
 
55
55
  public class loop {
56
56
 
57
- public static void main(String args[]) {
57
+    public static void main(String args[]) {
58
58
 
59
- EasyReader console = new EasyReader();
59
+       EasyReader console = new EasyReader();
60
60
 
61
61
 
62
62
 
63
- System.out.print("名前: ");
63
+       System.out.print("名前: ");
64
64
 
65
- String name = console.readLine();
65
+       String name = console.readLine();
66
-
67
- System.out.print("回数: ");
68
-
69
- int number = console.readInt();
70
66
 
71
67
 
72
68
 
73
- for (int i = 1; i <= number; i++){
69
+       System.out.print("回数: ");
74
70
 
75
- for (int j = 1; j <= i -1; j++){
71
+       int number = console.readInt();
76
-
77
- System.out.print(" ")
78
-
79
- } System.out.print(name);
80
72
 
81
73
 
82
74
 
75
+       for (int i = 1; i <= number; i++){
76
+
77
+          for (int j = 1; j <= i -1; j++){
78
+
79
+             System.out.print(" ")
80
+
81
+       }
82
+
83
- //この間にコードを書く
83
+       System.out.print(name);
84
84
 
85
85
 
86
86
 
87
- for (int j = 28; j >= i - 1; j--){
87
+       //この間にコードを書く
88
88
 
89
- System.out.print(" ");
90
89
 
91
- } System.out.print(name);
92
90
 
91
+          for (int j = 28; j >= i - 1; j--){
92
+
93
+             System.out.print(" ");
94
+
93
- }
95
+       }
96
+
97
+       System.out.print(name);
98
+
99
+    }
94
100
 
95
101
  }
96
102
 

1

書式の改善

2018/11/15 03:55

投稿

MS7789
MS7789

スコア13

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- JavaScriptを学び始めて3か月が経ち、
5
+ Javaを学び始めて3か月が経ち、
6
6
 
7
7
  『ユーザーに名前と数字を打たせ、その数字に応じてジグザグ状に名前を繰り返し出力し、30回目が出力されたら、折り返す』
8
8
 
@@ -50,7 +50,7 @@
50
50
 
51
51
  戻る方向に28回表示させるつもりです。
52
52
 
53
- ``` JavaScript
53
+ ``` Java
54
54
 
55
55
  public class loop {
56
56