Head vs breakz

[code] - 백준 함수 15596,4673,1065번 python 본문

Head/Code

[code] - 백준 함수 15596,4673,1065번 python

headbreakz 2020. 4. 3. 19:43

15596

#함수
#15596

def solve(a):
    
    return sum(a)

4673

#4673
a = [1 + i for i in range(10000)]

for i in range(10000) :
    b = list(str(i))
    c = 0
    for j in range(len(b)):
        c += int(b[j])
        
    d = c +i
    
    if d in a :
        a.remove(d)
        
    
for i in range(len(a)):
    print(a[i])
    

1065

#1065
a = int(input())

b = [1 + i for i in range(a)]


for j in range(len(b)+1):
        
    if j < 100 :
        pass
                
    elif j//100-(j%100)//10 != (j%100)//10-(j%100)%10 :
        b.remove(j)
        
print(len(b))
        
Comments