문제링크
https://www.acmicpc.net/problem/11022
나의코드
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int num = Integer.parseInt(br.readLine());
int a, b;
StringTokenizer st;
for(int i = 1; i <= num; i++){
st = new StringTokenizer(br.readLine()," ");
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
bw.write("Case #" + i + ": ");
bw.write(a + " + " + b + " = ");
bw.write((a + b) + "\n");
}
br.close();
bw.flush();
bw.close();
}
}
'Baekjoon Online Judge' 카테고리의 다른 글
[BOJ] 백준 2439번 별 찍기 - 2 (Java) (0) | 2023.01.27 |
---|---|
[BOJ] 백준 2438번 별 찍기 - 1 (Java) (0) | 2023.01.26 |
[BOJ] 백준 11021번 A+B - 7 (Java) (0) | 2023.01.08 |
[BOJ] 백준 15552번 빠른 A+B (Java) (0) | 2023.01.07 |
[BOJ] 백준 25304번 영수증 (Java) (0) | 2023.01.06 |
댓글