题目:
解决方法:
1 package com.algorithm.java.blueBirdge; 2 3 import java.util.Scanner; 4 5 public class leapYear { 6 public static void main(String[] args){ 7 Scanner read =new Scanner(System.in); 8 int year=read.nextInt(); 9 if(year%4==0 && year%100!=0 || year%400==0 ){ 10 System.out.println("yes"); 11 } 12 else{ 13 System.out.println("no"); 14 } 15 16 } 17 18 }
测试结果:
测试成功!
原文地址:https://www.cnblogs.com/Catherinezhilin/p/8482913.html
时间: 2024-10-10 00:55:27