
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int arr[] = new int[n];
for (int i = 0; i < n; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
arr[i] = a + b;
}
for (int k : arr) {
System.out.println(k);
}
}
}
'코딩 테스트 > Python - 백준 단계별로 풀어보기' 카테고리의 다른 글
백준 25304번 자바 - 영수증 (0) | 2024.04.12 |
---|---|
백준 8393번 자바 - 합 (0) | 2024.04.11 |
백준 2739번 자바 - 구구단 (0) | 2024.04.10 |
백준 2480번 자바 - 주사위 세개 (0) | 2024.04.04 |
백준 2525번 자바 - 오븐 시계 (0) | 2024.04.04 |

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int arr[] = new int[n];
for (int i = 0; i < n; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
arr[i] = a + b;
}
for (int k : arr) {
System.out.println(k);
}
}
}
'코딩 테스트 > Python - 백준 단계별로 풀어보기' 카테고리의 다른 글
백준 25304번 자바 - 영수증 (0) | 2024.04.12 |
---|---|
백준 8393번 자바 - 합 (0) | 2024.04.11 |
백준 2739번 자바 - 구구단 (0) | 2024.04.10 |
백준 2480번 자바 - 주사위 세개 (0) | 2024.04.04 |
백준 2525번 자바 - 오븐 시계 (0) | 2024.04.04 |