22.10.09 코테

김영태·2022년 10월 9일

백준 python 1065번
https://www.acmicpc.net/problem/1065

n= int(input())
hansu = 0

for i in range(1, n+1):
    if i <=99:
        hansu+=1
    else:
        i = list(str(i))
        if int(i[0]) - int(i[1]) == int(i[1]) - int(i[2]):
            hansu+=1
print(hansu)            

이걸 어떻게 풀었지.. 싶은 문제입니다. 아직도 문제를 제대로 이해한게 맞나 싶어요.

https://ooyoung.tistory.com/65
이 작성자분은

이렇게 코드를 작성하셨는데 str(i)를 씌울 생각은 하지 못했습니다.

다음엔 잘 되겠죠?

0개의 댓글