BOJ | 11022번

송치헌·2021년 6월 11일
0
post-thumbnail

Python 풀이

import sys

T = int(input())

for i in range(1, T+1):
    A, B = map(int, sys.stdin.readline().split())
    print(f"Case #{i}: {A} + {B} = {A+B}")

백준 11021번 문제와 똑같은 문제인 것 같다. 그냥 출력 형식이 다를 뿐....

C++ 풀이

#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, A, B;
    cin >> n;
    for(int i=1;i<=n;i++) {
    	cin >> A >> B;
    	cout << "Case #" << i << ": " << A <<" + "<<B<<" = " << A + B << '\n';
    }
}
profile
https://oraange.tistory.com/ 여기에도 많이 놀러와 주세요

0개의 댓글