<font face="宋体" size="3">
</font><p><span>提示用户输入月份和年份,然后显示这个月的天数。</span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri">public class ExamDemo {</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>public
static void main(String[] args) {</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>java.util.Scanner
input = new java.util.Scanner(System.in);</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>System.out.print("Enter
a month in the year (e.g., 1 for Jan): ");</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>int
month = input.nextInt();</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>System.out.print("Enter
a year: ");</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>int
year = input.nextInt();</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>int
numberOfDaysInMonth = 0;</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>switch
(month) {</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>case
1:</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>System.out.print("January
" + year);</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>numberOfDaysInMonth
= 31;</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>break;</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>case
2:</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>System.out.print("February
" + year);</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>if
(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>numberOfDaysInMonth
= 29;</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>else</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> </span>numberOfDaysInMonth
= 28;</font></span></p><font face="宋体" size="3">
</font><p><span lang="EN-US"><font face="Calibri"><span> &nb