백준 11022번: A+B - 8 [입출력] :: 매운코딩
728x90
300x250

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

 

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 sc = new Scanner(System.in);

		int N = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int A = sc.nextInt();
			int B= sc.nextInt();
			
			System.out.println("Case #" + (i + 1) + ": " + A + " + " + B + " = " + (A+B));
		}
	}

}
728x90

+ Recent posts