这个程序的问题出在哪
package com.imooc;import java.util.Scanner;
public class home {
Scanner input=new Scanner(System.in);
System.out.println("请输入年份:");
double year=input.nextDouble();
System.out.println("请输入月份:");
double month=input.nextDouble();
System.out.println("请输入第几天:");
double day=input.nextDouble();
if(month==1){
month=13;
year--;
}
if(month==2){
month=14;
year--;
}
if(month==13||month==3||month==5||month==7||month==8||month==10||month==12){
int q=31;
double m=month;
double j=year/100+1;
double k=year%100;
double h=((q+2.6*(m+1)+k+k/4+j/4+5*j)%7+2);
if(h==0)
System.out.println("星期六!");
else if(h==1)
System.out.println("星期天!");
else if(h==2)
System.out.println("星期一!");
else if(h==3)
System.out.println("星期二!");
else if(h==4)
System.out.println("星期三!");
else if(h==5)
System.out.println("星期四!");
else
System.out.println("星期五!");
}
if(month==4||month==6||month==9||month==11){
double q=30;
double m=month;
double j=year/100;
double k=year%100;
int b=(int)(q+2.6*(m+1)+k+k/4+j/4+5*j);
int h=(b%7);
if(h==0)
System.out.println("星期六!");
else if(h==1)
System.out.println("星期天!");
else if(h==2)
System.out.println("星期一!");
else if(h==3)
System.out.println("星期二!");
else if(h==4)
System.out.println("星期三!");
else if(h==5)
System.out.println("星期四!");
else
System.out.println("星期五!");
}
if(month==14){
if((year%4==0&&year%100!=0)||year%400==0){
double q=29;
double m=month;
double j=year/100+1;
double k=year%100;
double h=((q+2.6*(m+1)+k+k/4+j/4+5*j)%7);
if(h==0)
System.out.println("星期六!");
else if(h==1)
System.out.println("星期天!");
else if(h==2)
System.out.println("星期一!");
else if(h==3)
System.out.println("星期二!");
else if(h==4)
System.out.println("星期三!");
else if(h==5)
System.out.println("星期四!");
else
System.out.println("星期五!");
}
else{
double q=28;
double m=month;
double j=year/100+1;
double k=year%100;
double h=((q+2.6*(m+1)+k+k/4+j/4+5*j)%7);
if(h==0)
System.out.println("星期六!");
else if(h==1)
System.out.println("星期天!");
else if(h==2)
System.out.println("星期一!");
else if(h==3)
System.out.println("星期二!");
else if(h==4)
System.out.println("星期三!");
else if(h==5)
System.out.println("星期四!");
else
System.out.println("星期五!");
}
}
}
}
ps:这个程序可以执行,但是执行出来的结果与事实不符,请问问题出在哪?