请仔细阅读下列代码,要求代码修改,使之能实现输入一个年份,将该年的日历打印输出。 package cn.edu.ncu.chenyi.java.chapter02.comp; import java.time.LocalDate; /** * Calendar.java * Copyright: Nanchang University Information School Chen Yi * * @author * Created on 2019-03-01 15:14 * Description: **/ public class Calendar { public boolean isLeap(int year){ return year%400==0||(year%4==0&&year%100!=0); } public int getDays(int year,int month){ switch(month){ case 1: case 3: case 5: case 7: case 8: case 10: case 12:return 31; case 2: return isLeap(year)?29:28; default:return 30; } } public int getFirstWeek(int year,int month){ LocalDate firstDay=LocalDate.of(year,month,1); int week = firstDay.getDayOfWeek().getValue(); return week; } public void print(int year){ for(int i=1;i<13;i++){ System.out.printf("日 一 二 三 四 五 六\n"); int first=getFirstWeek(year,i); System.out.printf("%"+(3*first)+"s",first); } } }