백준/C#

[C#] 백준 2753번 : 윤년

joungdev 2025. 1. 22. 13:28

[C#] 백준 2753번 : 윤년

using System;

class Program
{
    static void Main()
    {
        string a = Console.ReadLine();
        string[] numbers = a.Split(' ');

        int num1 = int.Parse(numbers[0]);

        if ((((num1 % 4) == 0) && ((num1 % 100) != 0)) || ((num1 % 400) == 0))
        {
            Console.WriteLine("1");
        } else
        {
            Console.WriteLine("0");
        } 
    }
}
반응형

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

[C#] 백준 2884번 : 알람 시계  (0) 2025.01.22
[C#] 백준 14681번 : 사분면 고르기  (1) 2025.01.22
[C#] 백준 9498번 : 시험 성적  (0) 2025.01.22
[C#] 백준 1330번 : 두 수 비교하기  (0) 2025.01.22
[C#] 백준 10172번 : 개  (0) 2025.01.22