• python3计算鸡兔同笼的程序,但会出现小数,怎么样修改能让它如果算
  • python
    5.00元

def 鸡的只数(总只数,总脚数):      return (4*总只数-总脚数)//2 def 兔的只数(总只数,总脚数):      return (总脚数-2*总只数)//2 总只数= int(input("请输入鸡和兔共有几个头:")) 总脚数= int(input("请输入鸡和兔共有几只脚:")) print("鸡的只数=",鸡的只数(总只数,总脚数)) print("兔的只数=",兔的只数(总只数,总脚数))

  • Caroline    2020-01-15 17:24:26
  • 阅读 666    收藏 0    回答 1
  • 邀请
  • 收藏
  • 分享
发送
登录 后发表评论
  • 51testing软件测试圈微信