判断是不是闰年

 1 import java.util.Scanner;
 2 public class 闰年问题 {
 3 
 4     public static void main(String[] args) {
 5         // TODO Auto-generated method stub
 6 
 7         Scanner scanner=new Scanner(System.in);
 8         long year=scanner.nextInt();
 9         if(((year%4==0)&&(year%100!=0))||(year%400==0)) {
10             System.out.print('Y');
11         }else {
12             System.out.print('N');
13         }
14     }
15 
16 }

猜你喜欢

转载自www.cnblogs.com/kongchung/p/9727478.html