题解 | #百钱买百鸡问题#
百钱买百鸡问题
http://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b
let N = null;
while(N = readline()) {
//cock >=0 && cock <= 14
let res = [];
for(let i = 0; i < 15; i++) {
let hen = (100-7*i)/4;
if(hen % 1 === 0) {
res.push([i, hen, 100-i-hen])
}
}
res.map( ele => {
console.log(ele.join(' '))
})
}
while(N = readline()) {
//cock >=0 && cock <= 14
let res = [];
for(let i = 0; i < 15; i++) {
let hen = (100-7*i)/4;
if(hen % 1 === 0) {
res.push([i, hen, 100-i-hen])
}
}
res.map( ele => {
console.log(ele.join(' '))
})
}