首页 > 技术文章 > python3鸡兔同笼问题
yangxiaoqin 2018-05-12 11:03 原文
# 假设兔子有x只 for x in range(1,31): y = 30 - x if 4*x + 2*y == 90: print('兔子有%d只,鸡有%d只'%(x, y))