import java.util.Scanner;public class countday { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("请è¾å
¥å¹´ä»½");
int year = input.nextInt();
System.out.println("请è¾å
¥æ份");
int month = input.nextInt();
boolean bool ;
int num = 0;
if((year%4==0&&year%100!=0)||(year%400==0))
{
bool = true;
}
else
{
bool = false;
}
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
num =31;
break;
case 4:
case 6:
case 9:
case 11:
num = 30;
break;
case 2:
if(bool==true)
{
num=29;
}
else if(bool = false)
{
num =28;
}
break;
}
System.out.println(year+"å¹´"+month+"ææ"+num+"天");
}}
温馨提示:答案为网友推荐,仅供参考