10828 스택구현 java
-
boj)10828 - 스택구현PS/boj 2020. 9. 13. 19:10
import java.io.*; public class boj_10828 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); stack s = new stack(N); for (int i = 0; i < N; i++) { String str = br.readLine(); switch (str) { case "push" : s.push(Integer.parseInt(str.split(" ")[1])); case "pop" : s.pop(); ca..