代码如下:
for (let x = 1; x <= 9; x++) {
for (let y = 1; y <= 12; y++) {
for (let z = 1; z <= 36; z++) {
if (x + y + z == 36 && 4 * x + 3 * y + 0.5 * z == 36) {
console.log("男人:" + x + ",女人:" + y + ",小孩儿:" + z)
}
}
}
}