Beakjoon&프로그래머스/파이썬
[백준/파이썬] 6500번 랜덤 숫자 만들기
현장
2024. 7. 18. 15:10
-Code
while True:
a = int(input())
if a == 0:
break
res = [a]
while True:
a = str(a ** 2)
a = int(('0' * (8 - len(a)) + a)[2:-2])
if a in res:
break
res.append(a)
print(len(res))