본문 바로가기

[BOJ] - JAVA

[백준] 11021 : A+B-7 JAVA 풀이

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;

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());
        StringTokenizer st;
        
        for(int i=1;i<=N;i++){
            st = new StringTokenizer(br.readLine(), " ");
            System.out.printf("Case #%d: ", i);
            System.out.printf("%d\n", Integer.parseInt(st.nextToken())+Integer.parseInt(st.nextToken()));
        }
        
        br.close();
    }
}