编写JSP页面,计算2000-2013年中存在几个闰年
编写JSP页面,计算2000-2013年中存在几个闰年,谢谢
for(int i = 2000 ; i<=2013){
if(i==2000){
闰年
}
if( i %400==0 ){
闰年
}else {
平年
}
//特殊年份: 像 400、800 、1200、1600、2000年这种能被400整除是闰年
}
<!DOCTYPE html>
<html>
<head>
<title>MyHtml.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<script type="text/javascript">
function aa(){
var j=0;
for ( var int = 2000; int < 2013; int++) {
if(int %400==0){
j++;
}else if(int %100 !=0 && int%4==0){
j++
}
}
alert(j);
}
</script>
<body>
This is my HTML page. <br>
<button type="button" onclick="aa()" value="buttong">aaaa </button>
</body>
</html>