백준/C#

[C#] 백준 10869번 : 사칙연산

joungdev 2025. 1. 20. 18:17

[C#] 백준 10869번 : 사칙연산

using System;

namespace Hello {
    class Program {
        static void Main(string[] args) {
            string a = Console.ReadLine();
            
            string[] numbers = a.Split(' ');
            int num1 = int.Parse(numbers[0]);
            int num2 = int.Parse(numbers[1]);
            
            Console.WriteLine(num1 + num2);
            Console.WriteLine(num1 - num2);
            Console.WriteLine(num1 * num2);
            Console.WriteLine(num1 / num2);
            Console.WriteLine(num1 % num2);
        }
    }
}

 

반응형

'백준 > C#' 카테고리의 다른 글

[C#] 백준 18108번 : 1998년생인 내가 태국에서는 2541년생?!  (0) 2025.01.21
[C#] 백준 10926번 : ??!  (0) 2025.01.20
[C#] 백준 1008번 : A/B  (0) 2025.01.20
[C#] 백준 10998번 : A×B  (0) 2025.01.20
[C#] 백준 1001번 : A-B  (1) 2025.01.20