题解 | #将真分数分解为埃及分数#
将真分数分解为埃及分数
http://www.nowcoder.com/practice/e0480b2c6aa24bfba0935ffcca3ccb7b
while True: try: tar = input().split('/') res = '1/'+tar[1] for i in range(int(tar[0])-1): res+='+1/'+tar[1] print(res) except: break
参考大神的那个思路,
将真分数分解为埃及分数
http://www.nowcoder.com/practice/e0480b2c6aa24bfba0935ffcca3ccb7b
while True: try: tar = input().split('/') res = '1/'+tar[1] for i in range(int(tar[0])-1): res+='+1/'+tar[1] print(res) except: break
参考大神的那个思路,
相关推荐