📜  在python代码示例中计数加起来为10的数字

📅  最后修改于: 2022-03-11 14:46:32.301000             🧑  作者: Mango

代码示例1
# print numbers that add up to 10. (19 => 1 + 9 = 10)

x = 0

for i in range(100):
    for j in str(i):
        x+=int(j)
        
    if x == 10:
        print(i)
    x = 0
#                                                            - sabz