<!DOCTYPE html><html leng = \'en\'><head><meta charset = \'UTF-8\'/></head><body><script>for(var cockNum = 0; cockNum<= 19; cockNum++){for(var henNum = 0; henNum <= 33; henNum++){var poultNum = 100 - cockNum - henNum;if((cockNum * 5 + henNum * 3 + poultNum * (1/3) === 100) && poultNum % 3 === 0){console.log(\"可买鸡翁只数:\" + cockNum);console.log(\"可买鸡母只数:\" + henNum);console.log(\"可买鸡雏只数:\" + poultNum);}}}</script></body></html>
js写百钱买百鸡问题
未经允许不得转载:爱站程序员基地 » js写百钱买百鸡问题