/*依据输入的年份和月份,要求输出显示格式为某年某月及该月有多少天(英文格式)*/
//输出格式具体如下:
//代码实现:将月份天数和月份的英文单词单独存在相应类型的数组中,由于月份中是否闰年仅对二月的天数有影响
//对二月单独判断处理即可
package Game_Day;
import java.util.Scanner;
public class Test_One {
public static void main(String[] args) {
String Month_Name[]={"January","February","March","April","May","June","July"
,"August","September","October","November","December"};
int Days[]={31,28,31,30,31,30,31,31,30,31,30,31};
System.out.println(" Input year:");
Scanner sc =new Scanner(System.in);
int Year=sc.nextInt();
if(Year%4==0)
{
if(Year%100!=0)
{
Days[1]=29;
}
else
{
if(Year%400==0)
{
Days[1]=29;
}
}
}
else
{
Days[1]=28;
}
System.out.println("Input the moth:");
int Moth=sc.nextInt();
System.out.println(Month_Name[Moth-1]+","+Year+" "+"has"+" "+Days[Moth-1]+"days");
}
}