Determine if the year entered by the user is a leap year (1000-3000)
console.log( 请输入2000-2020年之间的年份
)
let inputyear = rs.question()-0;
if (inputyear >= 2000 && inputyear <= 2020) { (inputyear% 4 == 0 && inputyear% 100 == 0) || inputyear% 400 = = 0? Console.log( ): console.log( ); } else { console.log( ) } Note: For the time being, there is no consideration of limiting the input to integers, just input integers when trying to achieve judgment. Please understand if there are any deficiencies! !
您输入的${inputyear}是闰年
您输入的${inputyear}不是闰年
您输入的${inputyear}有误,不在2000-2020年之间