天天看點

輸入一個數字是否為閏年

package Test2016;
 import java.util.Scanner; 
 public class LeapYear {
  public static void main(String[] args) {
  System.out.println("請輸入年份");
  Scanner scan=new Scanner(System.in);
  while(true){int num=scan.nextInt();
  if(num%4==0&&num%100!=0||num%400==0){
      System.out.println(nu
  }else{
      System.out.println(num+"年不為閏年");
  }
     }
  }
 }