首页 > 其他 > 详细

鸡兔同笼2

时间:2020-03-29 00:51:47      阅读:69      评论:0      收藏:0      [点我收藏+]
a,b = map(int,input().split( ))
if(a > 0 and b >0 and b % 2 == 0 and b-2*a>0):
    for x in range(1,a+1):
        y=a-x
        if 2*x+4*y==b:
            print("{} {}". format(x,y))
else:
    print("Data Error!")

 

鸡兔同笼2

原文:https://www.cnblogs.com/670ling/p/12589982.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!