알고리즘/백준

[java] 백준 15552

henry.hong 2019. 11. 28. 12:08
import java.io.*;
import java.util.StringTokenizer;

public class P15552 {
    public static void main(String[] args) throws IOException {

        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        StringTokenizer st;

        int a  = Integer.parseInt(bf.readLine());
        for(int i = 0 ; i < a; i ++){
            st = new StringTokenizer(bf.readLine());

            int r1 = Integer.parseInt(st.nextToken());
            int r2 = Integer.parseInt(st.nextToken());
            int r = r1+r2;
            bw.write(r + "\n");

        }
        bw.flush();
    }
}

BufferedReader, BufferedWriter, StringTokenizer 를 사용하여 작성된 코드입니다.