using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List <int> leap1=new List <int>();
List<int> leap2 = new List<int>();
for(int year = 1900;year <= 9999;year++)
{
if(year % 4 == 0 && year % 100 != 0)
{
leap1.Add(year);
}
else if(year % 100==0 && year %400==0)
{
leap2.Add(year);
}
}
Console.WriteLine("被4整除的闰年");
foreach(int temp in leap1)
{
Console.WriteLine(temp);
}
Console.WriteLine("被400整除的闰年");
foreach(int temp in leap2)
{
Console.WriteLine(temp);
}
Console.Read();
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List <int> leap1=new List <int>();
List<int> leap2 = new List<int>();
for(int year = 1900;year <= 9999;year++)
{
if(year % 4 == 0 && year % 100 != 0)
{
leap1.Add(year);
}
else if(year % 100==0 && year %400==0)
{
leap2.Add(year);
}
}
Console.WriteLine("被4整除的闰年");
foreach(int temp in leap1)
{
Console.WriteLine(temp);
}
Console.WriteLine("被400整除的闰年");
foreach(int temp in leap2)
{
Console.WriteLine(temp);
}
Console.Read();
}
}
}