题解 | #百钱买百鸡问题#
百钱买百鸡问题
http://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b
while True:
try:
num = input()
for i in range(0,101):
for j in range(0,101):
for z in range(0,100,3):
if((i + j + z )== 100):
if((5 * i + 3 * j + 1 * z / 3) == 100):
print(str(i) + ' ' + str(j) + ' ' + str(z))
except:
break
穷举
华为机试题解(prod.by kedao) 文章被收录于专栏
华为实习机试题解