質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,28 @@
|
|
1
1
|
```javascript
|
2
|
+
|
3
|
+
process.stdin.resume();
|
4
|
+
|
5
|
+
process.stdin.setEncoding('utf8');
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
let lines = [];
|
10
|
+
|
11
|
+
let reader = require('readline').createInterface({
|
12
|
+
|
13
|
+
input: process.stdin,
|
14
|
+
|
15
|
+
output: process.stdout
|
16
|
+
|
17
|
+
});
|
18
|
+
|
19
|
+
reader.on('line', (line) => {
|
20
|
+
|
21
|
+
lines.push(line);
|
22
|
+
|
23
|
+
});
|
24
|
+
|
25
|
+
reader.on('close', () => {
|
2
26
|
|
3
27
|
let line = lines[0].split(' ');
|
4
28
|
|
@@ -44,6 +68,10 @@
|
|
44
68
|
|
45
69
|
}
|
46
70
|
|
71
|
+
});
|
72
|
+
|
73
|
+
|
74
|
+
|
47
75
|
```
|
48
76
|
|
49
77
|
```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,6 +46,32 @@
|
|
46
46
|
|
47
47
|
```
|
48
48
|
|
49
|
+
```
|
50
|
+
|
51
|
+
入力
|
52
|
+
|
53
|
+
3 25
|
54
|
+
|
55
|
+
-2 17
|
56
|
+
|
57
|
+
-7 20
|
58
|
+
|
59
|
+
2 24
|
60
|
+
|
61
|
+
```
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
期待される出力
|
66
|
+
|
67
|
+
C
|
68
|
+
|
69
|
+
A
|
70
|
+
|
71
|
+
B
|
72
|
+
|
73
|
+
```
|
74
|
+
|
49
75
|
上のコードを書くと、splitのところでCannot read property 'split' of undefinedこのようなエラーになってしまいます。
|
50
76
|
|
51
77
|
どうしたらよいのでしょうか?
|