상세 컨텐츠

본문 제목

백준 10950번

백준 알고리즘 풀이

by 발발개발 2020. 12. 14. 13:57

본문

원본 : https://www.acmicpc.net/problem/10950

 

10950번: A+B - 3

두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.

www.acmicpc.net

 

풀이

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int x[] = new int[n];
		int y[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}
		
		for (int i = 0; i < n; i++) {
			System.out.println(x[i] + y[i]);
		}
	}

}

'백준 알고리즘 풀이' 카테고리의 다른 글

백준 15552번  (0) 2020.12.14
백준 8393번  (0) 2020.12.14
백준 2739번  (0) 2020.12.14
백준 2884번  (0) 2020.12.14
백준 14681번  (0) 2020.12.14

관련글 더보기

댓글 영역