package zouye_1002;
import java.util.Scanner;
public class bianliyue {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入要查询年份");
int x = sc.nextInt();
System.out.println("请输入月份");
int y = sc.nextInt();
int[]arr={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
int[]arr1={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30};
int[]arr2={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
,16,17,18,19,20,21,22,23,24,25,26,27,28,29};
int[]arr3={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
,16,17,18,19,20,21,22,23,24,25,26,27,28};
shuzufangfa w = new shuzufangfa();
if(y==1){
w.bianli(arr);
}else if(y==2){
if(x%4==0){
w.bianli(arr2);
}else if(x%4!=0){
w.bianli(arr3);
}
}else if(y>2){
if(y<8){
if(y%2==0){
w.bianli(arr1);
}else if(y%2!=0){
w.bianli(arr);
}
}else if(y>7){
if(y%2==0){
w.bianli(arr);
}else if(y%2!=0){
w.bianli(arr1);
}
}
}
}
}
|
|