https://www.acmicpc.net/problem/11021
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main{
//BufferedReader를 사용하기위해선 예외처리가 필수
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int N = Integer.parseInt(br.readLine());
StringTokenizer st ;
for(int i = 1 ; i <= N ; i++) {
st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int c = a+ b;
bw.write("Case #"+i +": "+ c + "\n");
}
br.close();
bw.flush();
bw.close();
}
}
'프로그래밍언어 > 알고리즘' 카테고리의 다른 글
백준 2439_별 찍기2_JAVA (0) | 2023.05.04 |
---|---|
백준 2438 별 찍기_JAVA (0) | 2023.05.04 |
백준 15552번 빠른 A+B_JAVA (0) | 2023.05.04 |
백준 25314 코딩은 체육과목 입니다_JAVA (0) | 2023.05.02 |
백준 25304 영수증 (2) | 2023.05.02 |