Algorithm/BAEKJOON
[백준 알고리즘/python3] 11022번 A+B -8 문제풀이
찐무
2021. 1. 4. 17:06
728x90
반응형

문제
11022번: A+B - 8
각 테스트 케이스마다 "Case #x: A + B = C" 형식으로 출력한다. x는 테스트 케이스 번호이고 1부터 시작하며, C는 A+B이다.
www.acmicpc.net
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
입력
첫째 줄에 테스트 케이스의 개수 T가 주어진다.
각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10)
출력
각 테스트 케이스마다 "Case #x: A + B = C"형식으로 출력한다.
x는 테스트 케이스 번호이고 1부터 시작하며, C는 A+B이다.
예제 입력 | 예제 출력 |
5 1 1 2 3 3 4 9 8 5 2 |
Case #1: 1 + 1 = 2 Case #2: 2 + 3 = 5 Case #3: 3 + 4 = 7 Case #4: 9 + 8 = 18 Case #5: 5 + 2 = 7 |
<정답>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T = int(input()) | |
for i in range(1, T+1): | |
num1, num2 = map(int, input().split()) | |
sum = num1 + num2 | |
print('Case #%d: %d + %d = %d'%(i, num1, num2, sum)) |
728x90
반응형