본문 바로가기

[BOJ] - JAVA

[백준] 11022 : A+B-8 JAVA 풀이

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

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