質問編集履歴
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,9 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
```c
|
20
|
+
|
19
|
-
|
21
|
+
#include <stdio.h>
|
20
22
|
|
21
23
|
#include <stdlib.h>
|
22
24
|
|
@@ -136,6 +138,8 @@
|
|
136
138
|
|
137
139
|
}
|
138
140
|
|
141
|
+
|
142
|
+
|
139
143
|
```
|
140
144
|
|
141
145
|
|
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,11 +16,7 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
c言語
|
20
|
-
|
21
|
-
ソースコード
|
22
|
-
|
23
|
-
#include <stdio.h>
|
19
|
+
c言語```#include <stdio.h>
|
24
20
|
|
25
21
|
#include <stdlib.h>
|
26
22
|
|
@@ -34,8 +30,6 @@
|
|
34
30
|
|
35
31
|
|
36
32
|
|
37
|
-
/* stack���\���̂ŕ\�� */
|
38
|
-
|
39
33
|
struct stack{
|
40
34
|
|
41
35
|
int top;
|
@@ -45,8 +39,6 @@
|
|
45
39
|
};
|
46
40
|
|
47
41
|
|
48
|
-
|
49
|
-
/* �f�[�^���i�[ */
|
50
42
|
|
51
43
|
void push(struct stack *s, elemtype val){
|
52
44
|
|
@@ -67,8 +59,6 @@
|
|
67
59
|
}
|
68
60
|
|
69
61
|
|
70
|
-
|
71
|
-
/* �f�[�^���擾 */
|
72
62
|
|
73
63
|
elemtype pop(struct stack *s){
|
74
64
|
|
@@ -94,8 +84,6 @@
|
|
94
84
|
|
95
85
|
|
96
86
|
|
97
|
-
/* stack�������� */
|
98
|
-
|
99
87
|
void initstack(struct stack *s){
|
100
88
|
|
101
89
|
s->top = -1;
|
@@ -103,8 +91,6 @@
|
|
103
91
|
}
|
104
92
|
|
105
93
|
|
106
|
-
|
107
|
-
/* stack����Ȃ̂��m�F (��Ȃ�ΐ^(1)��Ԃ�)*/
|
108
94
|
|
109
95
|
int stackempty(struct stack *s){
|
110
96
|
|
@@ -122,23 +108,23 @@
|
|
122
108
|
|
123
109
|
|
124
110
|
|
125
|
-
initstack(&buf);
|
111
|
+
initstack(&buf);
|
126
112
|
|
127
113
|
|
128
114
|
|
129
|
-
while(scanf("%d", &e)){
|
115
|
+
while(scanf("%d", &e)){
|
130
116
|
|
131
117
|
if (e == EOF) break;
|
132
118
|
|
133
|
-
push(&buf, e);
|
119
|
+
push(&buf, e);
|
134
120
|
|
135
121
|
}
|
136
122
|
|
137
123
|
|
138
124
|
|
139
|
-
while(!stackempty(&buf)){
|
125
|
+
while(!stackempty(&buf)){
|
140
126
|
|
141
|
-
printf("%d ", pop(&buf));
|
127
|
+
printf("%d ", pop(&buf));
|
142
128
|
|
143
129
|
}
|
144
130
|
|
@@ -150,6 +136,8 @@
|
|
150
136
|
|
151
137
|
}
|
152
138
|
|
139
|
+
```
|
140
|
+
|
153
141
|
|
154
142
|
|
155
143
|
### 試したこと
|