Blogger Information
Blog 18
fans 1
comment 1
visits 11233
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
判断是不是闰年 3月25
至诚网络的博客
Original
661 people have browsed it
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<title>闰年</title>
</head>
<body>
<!-- 闰年应能被4整除(如2004年是闰年,而2001年不是闰年),但不是所有被4整除的年份都是闰年。在能被100整除的年份中,又同时能被400整除的年份才是闰年(如2000年是闰年),能被100整除而不能被400整除的年份(如1800、1900、2100)不是闰年 -->
<!-- 年份是整百数时,必须是400的倍数才是闰年;不是400的倍数的世纪年,即使是4的倍数也不是闰年 -->
<!-- (符合以下条件之一的年份即为闰年,反之则是平年)
1.能被4整除而不能被100整除。
2.能被100整除也能被400整除。 -->
<!-- 四年一闰,百年不闰,四百年再闰。 -->

<script type="text/javascript">
  var years =2004;
 if(years%400 == 0){
 	document.write(years,'年:是世纪闰年');
 }else if(years%4 ==0 && years%100 !==0){
 	document.write(years,'年:是闰年');
 }else{
 	document.write(years,'年:不是闰年');
 }

</script>
</body>
</html>


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!