蓝桥杯 基础练习 闰年判断

题目比较简单,输入的数字也没有超限,直接贴代码

 

import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int year = input.nextInt();
		if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)){
			System.out.println("yes");
		}else{
			System.out.println("no");
		}
		
	}
}

 

相关文章:

  • 2021-09-17
  • 2021-11-21
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2021-10-29
  • 2021-05-27
猜你喜欢
  • 2021-08-18
  • 2021-09-02
  • 2021-10-05
  • 2021-04-01
  • 2022-12-23
相关资源
相似解决方案