<script>
//公鸡5元一只,母鸡3元一只,小鸡一元3只,用一百块买一百只鸡,求每种鸡的数量,公鸡i,母鸡j,小鸡k
// 5 * i + 3 * j + k/3 == 100; //钱
// i + j + k == 100; //数量
//k=(100-3j-5i)3
//k=100-i-j
//300-9j-15i=100-i-j
//200-8j-14i=0
//8j+14i=200
//4j+7i=100
//i=(100-4j)/7 ------0<j<25
for (var j = 1; j < 25; j++) {
var i = (100 - 4 * j) / 7;
var k = 100 - i - j;
if ((i + j + k) == 100) {
if (i % 1 == 0 && j % 1 == 0 && k % 1 == 0) {
document.write(i + " ", j + " ", k + " ");
document.write("<br>");
}
}
}
</script>
用公式算的百钱百鸡思路