코딩/Baekjoon

[Python] 1065 :: 한수

연 동 2023. 5. 19. 12:26

https://www.acmicpc.net/problem/1065

 

 

n = int(input())

hansu_gaesu = 0

for i in range(1,n+1):
    numlist = list(map(int, str(i)))

    if len(numlist) <= 2:
        hansu_gaesu += 1
    elif (numlist[0] + numlist[2])/2 == numlist[1]:
        hansu_gaesu += 1
    else:
        pass

print(hansu_gaesu)
728x90

'코딩 > Baekjoon' 카테고리의 다른 글

파이썬 문법정리(2022)  (0) 2023.05.28
[Python] 단계별로 풀어보기 :: 05/24  (0) 2023.05.24
[Python] 2581 :: 소수  (0) 2023.05.18
[Python] 4673 :: 셀프 넘버  (0) 2023.05.18
[Python] 13414 :: 수강신청  (0) 2023.05.18