您的位置:网大 >> 网络 >> 网页特效 >> 正文

数字式网页特效

作者:不详时间:2006-1-5 17:13:52

大个鸡9块一只,中个鸡6块一只,小个鸡1块一只,300块钱,买一百只鸡,大中小鸡各多少个!
让javascript给你算一下!

 

代码如下:

<html>
<head>
<title>大小鸡-www.51windows.Net</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="www" content="www.51windows.com">
<script language=javascript>
function cal() {
var tempStr;
tempStr="";
 for(bigCh=1;bigCh<34;bigCh++) {
  for(smallCh=1;smallCh<300;smallCh++) {
   for(midCh=1;midCh<51;midCh++) {
    if((bigCh+smallCh+midCh==100) && (9*bigCh+smallCh+6*midCh==300)) {
     tempStr+="大、小、中鸡各有"+bigCh+"只、 "+smallCh+"只、 "+midCh+"只\n";   
     //alert(bigCh+":"+smallCh+":"+midCh);
     break; 
    }
    
   }
   
  }
 }
alert(tempStr) 
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
大个鸡9块一只,中个鸡6块一只,小个鸡1块一只,300块钱,买一百只鸡,大中小鸡各多少个!<br>
让javascript给你算一下!<button onclick=cal()>计算</button>
</body>
</html>

<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>


评论数: 来源:不详


网大首页 - 网站地图 - 广告服务 - 关于网大 - 招聘信息 - 联系我们
Copyright (C) 1999-2005 NETBIG.COM (CHINA) LIMITED All Rights Reserved
粤B-20050190