
> Keyword : Statck
오타때문에 50프로에서 계속 걸렸는데 알고 보니 bw.write("Case #"+i+":");에서 "Case #"+i+":" 같이 띄워쓰기를 하지 않아 에러발생.......
정말 어이가 없었음.
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
BufferedWriter bw =new BufferedWriter(new OutputStreamWriter(System.out));
for(int i = 1; i<=N; i++){
Stack<String> stack = new Stack<String>();
StringTokenizer st = new StringTokenizer(br.readLine());
while(st.hasMoreTokens()){
stack.add(st.nextToken());
}
bw.write("Case #"+i+": ");
while(!stack.isEmpty()){
bw.write(stack.pop()+" ");
}
bw.write("\n");
}
bw.flush();
bw.close();
}
}