# 搜狗第一题 神奇的数列 x = int(input()) dict1 = {} for m in range(1,100):     dict1[m] = 0 for f1 in range(1, 100):     for f2 in range(1, 100):         s = 0         i = 2 #下标         a = f1         b = f2         while s <= x:             s = a + b             i += 1             if s == x:                 if dict1[i] == 0:                     temp = 0                 dict1[i] += 1                 break             a = b             b = s for m,n in sorted(dict1.items()):     if n !=0:         print(m,n)
点赞 4

相关推荐

点赞 评论 收藏
分享
Beeee0927:正确的建议
点赞 评论 收藏
分享
牛客网
牛客企业服务