본문으로 바로가기

[Baekjoon 4단계(1)] 10952번 : A+B - 5

category Baekjoon 문제풀이 2021. 8. 31. 16:16

출제 링크 : https://www.acmicpc.net/problem/10952

 

10952번: A+B - 5

두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.

www.acmicpc.net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Solution
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();
            bool repeat = true;

            while(repeat)
            {        
                string[] numbers = Console.ReadLine().Split();
                int A = int.Parse(numbers[0]);
                int B = int.Parse(numbers[1]);

                if(A ==0 || B==0) break;

                sb.Append($"{A + B}\n");            
            }
            Console.Write(sb);
        }
    }
}