본문 바로가기
알고리즘풀이/백준-자바

[백준/JAVA] 15552번 빠른 A+B

by 이얏호이야호 2020. 7. 20.

import java.io.BufferedReader;

import java.io.BufferedWriter;

import java.io.IOException;

import java.io.InputStreamReader;

import java.io.OutputStreamWriter;

import java.util.Stack;


public class Main {

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

BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

String s = bf.readLine();

int input1 = Integer.parseInt(s);

int input2, input3, result;

for (int i = 0; i < input1; i++) {

s = bf.readLine();

String arr[] = s.split(" ");

input2 = Integer.parseInt(arr[0]);

input3 = Integer.parseInt(arr[1]);

result = input2 + input3;

bw.write(result+"\n");

}

bw.flush();

bw.close();

}

}

더 많은 백준 코드가 보고 싶다면 ?  https://chuinggun.tistory.com/category/%EB%B0%B1%EC%A4%80


댓글