NO.11021
풀이코드
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int i=1; i<=T; i++){
int A = sc.nextInt();
int B = sc.nextInt();
System.out.println("Case #" + i + ": " + (A + B));
}
sc.close();
}
}
📌 Case #1 부터 시작이라 i 를 1부터로 하고 T보다 작거나 같을때까지 반복하라고 지정.
'JAVA-BAEKJOON > 3단계 반복문' 카테고리의 다른 글
[백준/03-09] 2438 별 찍기 - 1 (0) | 2024.02.27 |
---|---|
[백준/03-08] 11022 A+B - 8 (0) | 2024.02.27 |
[백준/03-06] 15552 빠른 A+B (0) | 2024.02.26 |
[백준/03-05] 25314 코딩은 체육과목 입니다 (0) | 2024.02.26 |
[백준/03-04] 25304 영수증 (0) | 2024.02.26 |