回答編集履歴

4

コードの変更

2020/08/14 00:11

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  for (byte[] b = new byte[3]; System.in.read(b) == 3; )
28
28
 
29
- System.out.print((char)((Integer.valueOf(new String(b)) - 13) / 3));
29
+ System.out.write((Integer.valueOf(new String(b)) - 13) / 3);
30
30
 
31
31
  System.out.println();
32
32
 

3

変数名変更

2020/08/14 00:11

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -48,13 +48,13 @@
48
48
 
49
49
  public static void main(String[] args) throws IOException {
50
50
 
51
- String p = "";
51
+ String s = "";
52
52
 
53
53
  for (int c; (c = System.in.read()) >= ' '; )
54
54
 
55
- p += c * 3 + 13;
55
+ s += c * 3 + 13;
56
56
 
57
- System.out.println(p);
57
+ System.out.println(s);
58
58
 
59
59
  }
60
60
 

2

コードを 2通りに変更

2020/08/14 00:08

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -8,11 +8,11 @@
8
8
 
9
9
  public static void main(String[] args) throws IOException {
10
10
 
11
- String s = "";
11
+ for (int c; (c = System.in.read()) >= ' '; )
12
12
 
13
- for (int c; (c = System.in.read()) >= ' '; ) s += c*3+13;
13
+ System.out.print(c * 3 + 13);
14
14
 
15
- System.out.println(s);
15
+ System.out.println();
16
16
 
17
17
  }
18
18
 
@@ -26,9 +26,53 @@
26
26
 
27
27
  for (byte[] b = new byte[3]; System.in.read(b) == 3; )
28
28
 
29
- System.out.write((Integer.valueOf(new String(b))-13)/3);
29
+ System.out.print((char)((Integer.valueOf(new String(b)) - 13) / 3));
30
30
 
31
31
  System.out.println();
32
+
33
+ }
34
+
35
+ }
36
+
37
+ ```
38
+
39
+ または
40
+
41
+ ```Java
42
+
43
+ import java.io.IOException;
44
+
45
+
46
+
47
+ class Encrypt {
48
+
49
+ public static void main(String[] args) throws IOException {
50
+
51
+ String p = "";
52
+
53
+ for (int c; (c = System.in.read()) >= ' '; )
54
+
55
+ p += c * 3 + 13;
56
+
57
+ System.out.println(p);
58
+
59
+ }
60
+
61
+ }
62
+
63
+
64
+
65
+ class Decrypt {
66
+
67
+ public static void main(String[] args) throws IOException {
68
+
69
+ String s = "";
70
+
71
+ for (byte[] b = new byte[3]; System.in.read(b) == 3; )
72
+
73
+ s += (char)((Integer.valueOf(new String(b)) - 13) / 3);
74
+
75
+ System.out.println(s);
32
76
 
33
77
  }
34
78
 

1

コード変更

2020/08/14 00:07

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  for (byte[] b = new byte[3]; System.in.read(b) == 3; )
28
28
 
29
- System.out.print((char)((Integer.valueOf(new String(b))-13)/3));
29
+ System.out.write((Integer.valueOf(new String(b))-13)/3);
30
30
 
31
31
  System.out.println();
32
32