<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>万年历</title>
</head>
<body>
<script>
let totalDays = 0
let year = +prompt("请输入年份")
let month = +prompt("请输入月份")
let days
for (let i = 1900; i < year; i++) {
if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) {
totalDays += 366
} else {
totalDays += 365
}
}
for (let j = 1; j < month; j++) {
switch (j) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
totalDays += 31
break
case 4:
case 6:
case 9:
case 11:
totalDays += 30
break
case 2:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
totalDays +=
03-28
04-06
04-30