回答編集履歴
2
ソース修正
test
CHANGED
@@ -2,38 +2,76 @@
|
|
2
2
|
|
3
3
|
```c
|
4
4
|
|
5
|
-
do
|
5
|
+
#include <stdio.h>
|
6
6
|
|
7
|
-
|
7
|
+
//
|
8
8
|
|
9
|
-
|
9
|
+
int main( )
|
10
10
|
|
11
|
-
|
11
|
+
{
|
12
12
|
|
13
|
-
}
|
14
|
-
|
15
|
-
if(scanf("%d",&y) != 1){
|
16
|
-
|
17
|
-
puts("readerror:y");
|
18
|
-
|
19
|
-
|
13
|
+
int x, y, i;
|
20
|
-
|
21
|
-
}
|
22
14
|
|
23
15
|
|
24
16
|
|
17
|
+
do {
|
18
|
+
|
19
|
+
if(scanf("%d", &x) != 1) {
|
20
|
+
|
25
|
-
|
21
|
+
puts("readerror:x");
|
22
|
+
|
23
|
+
break;
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
if(scanf("%d", &y) != 1) {
|
28
|
+
|
29
|
+
puts("readerror:y");
|
30
|
+
|
31
|
+
break;
|
32
|
+
|
33
|
+
}
|
26
34
|
|
27
35
|
|
28
36
|
|
29
|
-
|
37
|
+
// 実行内容をここに
|
30
38
|
|
31
|
-
puts("readerror:i");
|
32
39
|
|
33
|
-
break;
|
34
40
|
|
35
|
-
|
41
|
+
if(scanf("%d", &i) != 1) {
|
36
42
|
|
43
|
+
puts("readerror:i");
|
44
|
+
|
45
|
+
break;
|
46
|
+
|
47
|
+
}
|
48
|
+
|
37
|
-
}while(i);
|
49
|
+
} while(i); // i == 0ならぬける
|
50
|
+
|
51
|
+
//
|
52
|
+
|
53
|
+
return 0;
|
54
|
+
|
55
|
+
}
|
38
56
|
|
39
57
|
```
|
58
|
+
|
59
|
+
結果
|
60
|
+
|
61
|
+
usr ~/Project/test % ./a.out
|
62
|
+
|
63
|
+
a
|
64
|
+
|
65
|
+
readerror:x
|
66
|
+
|
67
|
+
usr ~/Project/test % ./a.out
|
68
|
+
|
69
|
+
1 2 2
|
70
|
+
|
71
|
+
1 a 2
|
72
|
+
|
73
|
+
readerror:y
|
74
|
+
|
75
|
+
usr ~/Project/test % ./a.out
|
76
|
+
|
77
|
+
1 2 0
|
1
誤記修正
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
if(scanf("%d",&i) != 1){
|
30
30
|
|
31
|
-
pus("readerror:i");
|
31
|
+
puts("readerror:i");
|
32
32
|
|
33
33
|
break;
|
34
34
|
|