蓝桥杯——基础练习之闰年判断

package _2_base;

import java.util.Scanner;

public class _1_LeapYear {
	public static void main(String[] args) {
		judge();
	}
	public static void judge() {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
//		记住:闰年判断条件,还有,闰年2月有29天。
		if (m%4==0&&m%100!=0||m%400==0) {
			System.out.println("yes");
		}else {
			System.out.println("no");
		}
	}
}

发布了27 篇原创文章 · 获赞 2 · 访问量 941

猜你喜欢

转载自blog.csdn.net/wcy8733996wcy/article/details/104290295
今日推荐