A+B - 8 (11022)

944 단어 백준OJ백준OJ

Java 11

import java.io.*;
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 s = Integer.parseInt(br.readLine());
        int a;
        int b;

        StringTokenizer st;
        for (int i=1; i<=s; 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();
    }
}

좋은 웹페이지 즐겨찾기