백준 10951 A+B -4

Console Programming/C# Console 2019. 9. 26. 17:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
 
namespace _10952
{
    class Program
    {
        static void Main(string[] args)
        {
            string str;
            while ((str = Console.ReadLine())!= null)
            {                
                string[] arr = str.Split(' ');
                int a = int.Parse(arr[0]);
                int b = int.Parse(arr[1]);                
                Console.WriteLine(a + b);
            }
        }
    }
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

7 아래에 아무것도 입력하지 않을 때는 null을 받게 되므로 프로그램이 종료된다.

'Console Programming > C# Console' 카테고리의 다른 글

문자열 다루기 string. Method  (0) 2019.09.27
백준 1110 더하기사이클  (0) 2019.09.26
백준 10952 A+B -5  (0) 2019.09.26
백준 10950 A+B -3  (0) 2019.09.26
백준 2739 구구단  (0) 2019.09.26
: