You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><span style="color:#e74c3c;"><code>2</code></span>: 스택에 정수가 있다면 맨 위의 정수를 빼고 출력한다. 없다면 <span style="color:#e74c3c;"><code>-1</code></span>을 대신 출력한다.</li>
26
+
<li><span style="color:#e74c3c;"><code>3</code></span>: 스택에 들어있는 정수의 개수를 출력한다.</li>
27
+
<li><span style="color:#e74c3c;"><code>4</code></span>: 스택이 비어있으면 <span style="color:#e74c3c;"><code>1</code></span>, 아니면 <span style="color:#e74c3c;"><code>0</code></span>을 출력한다.</li>
28
+
<li><span style="color:#e74c3c;"><code>5</code></span>: 스택에 정수가 있다면 맨 위의 정수를 출력한다. 없다면 <span style="color:#e74c3c;"><code>-1</code></span>을 대신 출력한다.</li>
29
+
</ol>
30
+
31
+
### 입력
32
+
33
+
<p>첫째 줄에 명령의 수 <var>N</var>이 주어진다. (1 ≤ <var>N</var> ≤ 1,000,000)</p>
34
+
35
+
<p>둘째 줄부터 <var>N</var>개 줄에 명령이 하나씩 주어진다.</p>
36
+
37
+
<p>출력을 요구하는 명령은 하나 이상 주어진다.</p>
38
+
39
+
### 출력
40
+
41
+
<p>출력을 요구하는 명령이 주어질 때마다 명령의 결과를 한 줄에 하나씩 출력한다.</p>
0 commit comments