관리 메뉴

Storage Gonie

(6) [C++, Python] 백준 No.10952 A+B - 5 본문

알고리즘/백준풀이1. 입출력

(6) [C++, Python] 백준 No.10952 A+B - 5

Storage Gonie 2019. 4. 18. 15:12
반응형

문제

풀이

# C++

#include <iostream>

using namespace std;

int main(void)
{
    int a = 0;
    int b = 0;

    while( cin >> a >> b && a != 0 && b != 0)
    {
        cout <<  a+b  << endl;
    }
}

 

# Python

while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    else:
        print(a + b)
import sys

for line in sys.stdin:
    a, b = map(int, line.split())
    if a == 0 and b == 0:
        break
    else:
        print(a + b)
반응형
Comments