two left
This commit is contained in:
19
labs/lab3_done/IsLeapYear/Program.cs
Normal file
19
labs/lab3_done/IsLeapYear/Program.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("input a year: ");
|
||||
int year = int.Parse(Console.ReadLine());
|
||||
|
||||
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
|
||||
{
|
||||
Console.WriteLine("YES");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("NO");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user