이번 문제 또한 스택의 기본적인 구조만 알고 있다면 메서드를 통해서 간단하게 구현할 수 있다. import java.io.*; import java.util.Stack; public class S10773 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Stack stack = new Stack(); int sum = 0; int K = Integer.parseInt(br.readLine()); while(K --> 0) { int input = Integer.parseInt(br.readLine()); if(i..