• 문제 링크
https://www.acmicpc.net/problem/11104
• 풀이 코드
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class Main {
static StringBuilder sb = new StringBuilder();
public static void main(String[] args) throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();
int n = Integer.parseInt(read());
while (n-- > 0) sb.append(Integer.parseInt(read(), 2)).append('\n');
bw.write(sb.toString());
bw.flush();
}
private static String read() throws IOException {
sb.setLength(0);
int c;
while ((c = System.in.read()) > 47) sb.append((char) c);
return sb.toString();
}
}
'Problem Solving > Baekjoon' 카테고리의 다른 글
[백준] 18022 Eeny Meeny - Data Structure / Java (0) | 2025.05.27 |
---|---|
[백준] 6527 빙고라니! - Data Structure / Java (0) | 2025.05.26 |
[백준] 10599 페르시아의 왕들 - Implementation / Java (0) | 2025.05.24 |
[백준] 4108 지뢰찾기 - Implementation / Java (0) | 2025.05.23 |
[백준] 1308 D-Day - Implementation / Java (0) | 2025.05.22 |
댓글