package zuoye;
import java.util.Scanner;
public class Nf {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("请输入年份:");
Scanner s= new Scanner(System.in);
int a=s.nextInt();
boolean b;
int [] arr={31,28,31,30,31,30,31,31,30,31,30,31};
int [] arr1={31,28,31,30,31,30,31,31,30,31,30,31};
int j=0;
if(((a%4==0)&(a%100!=0))|(a%400==0))
{b=true;
System.out.println("闰年");
}
else{
b=false;
System.out.print("平年");
}
if(b){
for(int i:arr){
j++;
System.out.print(j+"月"+i+"天");
}
}
else{
for(int i:arr1){
if(j%4==0){
System.out.print("\n");
}
j++;
System.out.print(j+"月"+i+"天\t");}
}
}}
代码运行如下图