兔子和鸡共有三十只,九十支脚 简单for循环 for a in range(31): b=(30-a) if 2*a+4*b==90: print('鸡有{}脚,兔子有{}脚'.format(a,b))