본문 바로가기
개발/백준 & 프로그래머스

[백준]10952번 A+B -5 c/c++

by 성장하고픈개발자 2022. 6. 27.
728x90
728x90

문제

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

나의 해결방법
a와 b가 0일때 while문 break해서 빠져나온다.


#include<iostream>
using namespace std;

int main()
{
    int a, b;
    while (1) {
        cin >> a >> b;
        if (a == 0 && b == 0) {
            break;
        }
        cout << a + b << endl;
    }
    return 0;
}

피드백
a+b 값을 출력해주기만하면 되는 간단한 문제

728x90
728x90