一个 switch case 不就解决了?

=================上午比较闲==================

public static void main (String arge[]){

int year = 2008;

int month = 12;

int day = 11;

int count=0;

switch(month)

case 12:

count += 30;

case 11:

count += 31;

case 10:

count += 30;

case 9:

count += 31;

case 8:

count += 30;

case 7:

count += 31;

case 6:

count += 31;

case 5:

count += 30;

case 4:

count += 31;

case 3:

count += 28;

case 2:

count += 31;

case 1:

count += 0;

count += day;

if (year%4==0&&year%100!=0&&month>=3)

{count += 1;}

System。

  out。print(count);

用JavaScript function getDaysInMonth(year,month){

month = parseInt(month,10)+1;

var temp = new Date(year+"/"+month+"/0");

return temp.getDate();