원본 : 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]);
}
}
}
댓글 영역