728x90
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
for(int i=0;i<test;i++) {
int A = sc.nextInt();
int B = sc.nextInt();
System.out.println(A+B);
}
}
}
test횟수를 for문 밖에서 입력받고
이후엔 test횟수만큼 A와 B를 입력받아 A+B를 출력할 수 있도록 한다.
728x90
'백준 단계별' 카테고리의 다른 글
[Java] 백준 25304: 영수증 (0) | 2023.01.04 |
---|---|
[Java] 백준 8393: 합 (0) | 2023.01.04 |
[Java] 백준 2480: 주사위 세개 (0) | 2023.01.03 |
[Java] 백준 2525: 오븐 시계 (0) | 2023.01.03 |
[Java] 백준 2884: 알람 시계 (0) | 2023.01.03 |