<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> </body> </html> <script type="text/javascript"> var nian = Number(prompt("请输入年份")); var yue = Number(prompt("请输入月份")); if(yue ==1 ||yue ==3 ||yue ==5 ||yue ==7 ||yue ==9||yue ==11 ) { alert("31天"); } else if(yue ==2) { if ( (nian % 4 == 0) && (nianfen % 100 != 0)) { alert(nian+"瑞年"+"29天"); } else if(!(nian % 400 == 0)) { alert(nian+"瑞年"+"29天"); } else { alert(nian+"平年"+"28天"); } } else{ alert("30天"); } </script>
原文地址:https://www.cnblogs.com/hankai2735/p/8776482.html
时间: 2024-10-09 13:45:36