LeapYear先行版

经过不断调试与运行,终于赶出了这个程序

 import javax.swing.*;
public class jie {
 public static void main (String args[]){
	 int y;
	String s=(String)JOptionPane.showInputDialog(null,"请输入一个数","输入对话框",
			JOptionPane.PLAIN_MESSAGE,null,null,null);
    y=Integer.parseInt(s);
 {
  if(y%4==0&&y%100!=0){
   System.out.println(y+"年是润年");
  }
  else if(y%400==0){
   System.out.println(y+"年是润年");
  }
  else{
   System.out.println(y+"年不是润年");
  }
 }
 }
}

LeapYear先行版_第1张图片

LeapYear先行版_第2张图片

你可能感兴趣的:(LeapYear先行版)