import java.util.Random;
public class Exercise7_2 {
public static void main(String[] args)
{
// TODO Auto-generated method stub
Exercise7_2 e=new Exercise7_2();
System.out.println(e.getMonth()+"月共有"+e.getNumOfDays(e.getMonth())+"天。");
}
int getMonth()
{
Random r=new Random();
int month=r.nextInt(12)+1;
return month;
}
int getNumOfDays(int month)
{
int num;
if(month==2) num=28;
else if(month<=7&&month%2==1||month>7&&month%2==0) num=31;
else num=30;
return num;
}
}