본문 바로가기
Baekjoon/브론즈 5

[백준][JAVA/자바] 11022번: A+B - 8

by 감자감자곰 2022. 12. 14.

<단계>

브론즈 5


<문제>

 

11022번: A+B - 8

각 테스트 케이스마다 "Case #x: A + B = C" 형식으로 출력한다. x는 테스트 케이스 번호이고 1부터 시작하며, C는 A+B이다.

www.acmicpc.net


<코드>

import java.util.Scanner;

public class Main {

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

		int num = s.nextInt();

		for (int i = 0; i < num; i++) {
			int a = s.nextInt();
			int b = s.nextInt();

			System.out.println("Case #" + (i + 1) + ": " + a + " + " + b + " = " + (a + b));
		}

		s.close();
	}

}

댓글