본문 바로가기
BaekJoon

[백준 알고리즘] [10950번 A+B-3] 자바 코드

by MiZoo 2020. 8. 31.

반갑습니다! 미주입니다:^)

 

이번에는 "10950번 A+B-3" 문제입니다!

정말 간단한 문제이므로 풀이 없이 바로 자바 코드를 올려드리겠습니다 하핳 :^)

 

[문제&입력&출력]

백준알고리즘 10950번 A+B-3
백준알고리즘 10950번 A+B-3

 

[자바 코드]

import java.io.*;
public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		int T;
		int[] result;
		String[] arrStr = new String[2];
		
		T = Integer.valueOf(br.readLine());
		result = new int[T];
		 for(int i = 0; i < T; i++) {
			 arrStr = br.readLine().split(" ");
			 result[i] = Integer.parseInt(arrStr[0]) + Integer.parseInt(arrStr[1]);
		}
		 
		 for(int j = 0; j < result.length; j++) {
			 bw.write(String.valueOf(result[j]));
			 bw.newLine();
		 }
			 
		 bw.close();
	}
}

알려드린 것이 도움되길 바라며 다들 자바 공부 열심히 하세요~!~! :^)

댓글