题解 | #判断闰年#

判断闰年

http://www.nowcoder.com/practice/a7bcbe3cb86f435d9617dfdd20a16714

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

全部评论

相关推荐

喵_coding:年底缺人是短视频营造出来的 而且一般说的也很宽泛 不是特指后端
点赞 评论 收藏
分享
评论
3
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务