站 内 搜 索
推 荐 合 作 商
优 秀 内 容 推 荐
  您当前位置:中国素材首页 >> 网页特效 >> 数学类 >> 100只鸡
 
100只鸡
中国素材网 www.sucai.com 2005-3-31 13:01:00 流量数:

100只鸡
[查看演示]  源码如下
----------------------------------------------------------------------------------------
<html>
<head>
<title>大小鸡-www.Sucai.com</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>