java实现万年历

题目:输出万年历
提示:1900年1月1日是星期一

import java.util.Scanner;

public class Calendar {
    public static void main(String[] args){
    	Help util =new Help();
    	Scanner sc= new Scanner(System.in);
    	System.out.println("请输入年");
    	int year = sc.nextInt();
    	boolean ynleapyear = Help.ynleapyear(year);
    //	System.out.println("是否是闰年"+ynleapyear);
    	Scanner sc1= new Scanner(System.in);
    	System.out.println("请输入月");
    	int month = sc1.nextInt();
    	int getMonthdays = Help.getMonthdays(year, month);
    //	System.out.println("当前月有几天:"+getMonthdays);
    	int yeartotaldays =Help.yeartotaldays(year);//每一年总天数
    	int totalmonthdays=Help.totalmonthdays(year, month);//当前年输入月前面月份的总天数
    	int sumdays = yeartotaldays+totalmonthdays;//总天数
    	//System.out.println("总天数:"+sumdays);
    	int firstday =Help.firstday(sumdays);//当前月第一天是周几
    	//System.out.println("第一天是:"+firstday);
    	System.out.println("周日\t周一\t周二\t周三\t周四\t周五\t周六");
    	int i =1;
    	if(i!=7){
    		for (i=0;i

你可能感兴趣的:(java实现万年历)