题解 | #将真分数分解为埃及分数#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
终于全部刷完了。。最后一题纪念下自己写吧。。。,虽然弄得很复杂。
while True: try: s = input()[::-1] flag = 1 res = '' for thing in s: if not thing.isalpha(): flag = 0 continue else: if flag == 0: res+=' '+thing flag = 1 else: res+=thing res = ' '.join(list(map(lambda x:x[::-1], res.split(' ')))) print(res) except: break