import java.util.Scanner;
public class bissextile {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int count=0, year,i;
System.out.printf("请输入要判断的开始年份:");
int start=in.nextInt();
System.out.printf("请输入要判断的结束年份:");
int end=in.nextInt();
if(start>end)
{
i=start;//交换start和end的数值
start=end;
end=i;
for(year=start;year<=end;year++)
{
if((year%4==0&&year%100!=0)||(year%400==0)) //判断条件
System.out.printf("%d\n",year);
count++;
}
}
else{
for(year=start;year<=end;year++)
{
if((year%4==0&&year%100!=0)||(year%400==0)) //判断条件
System.out.printf("%d\n",year);
count++;
}
}
System.out.printf("共计"+count+"年\n");
}
}