백준 11021번 A + B - 7(java)

마뇽미뇽·2024년 4월 29일
0

알고리즘 문제풀이

목록 보기
27/165

1.문제

https://www.acmicpc.net/problem/11021

2.풀이

case 뒤에 수는 testcase로 반복하는 값과 동일하다.

3.코드

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();
    }
}
profile
Que sera, sera

0개의 댓글