[백준] 11021 : A+B - 7 - Java

길 잃은 까마귀·2022년 9월 13일
0

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


  • 문제

  • 풀이
    솔직히 말하면 A+B - 3과 똑같은 문제이다. 중간에 case만 덧붙이면 되는 사실상 말장난으로 느껴지는 문제인거같다.

  • 코드
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();
		int arr[] = new int[t];
		for (int i = 0; i < t; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			arr[i] = a + b;
		}
		for (int i = 0; i < t; i++) {
			System.out.println("Case #" + (i + 1) + ": " + arr[i]);
		}
		sc.close();
	}
}
profile
코딩 고수가 될 사람

0개의 댓글