built-in method

سال کبیسه
سال کبیسه در مسیر PowerShell
function Test-Leap([int] $year) {
    [DateTime]::IsLeapYear($year)
}

Utilizing the DateTime class from .NET, you can determine if a year is a leap year or not by passing it into the IsLeapYear static method. This might not be the intended approach for learning, but it is an idiomatic way to check if a year is leap or not.

IsLeapYear method.

23 سپتامبر 2026 · برایتان مفید بود؟

رویکردهای دیگر برای تمرین سال کبیسه در مسیر PowerShell

روش‌های دیگری که جامعه‌ی ما این تمرین را با آن‌ها حل کرده است