Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = int(input())
- if num == 1:
- print(1)
- else:
- num -= 1
- ab = 10
- l =1
- n = 2
- while num > 0:
- if num > l:
- num -= l
- n += 1
- t = n ** 2
- while ab < t:
- ab *= 10
- l += 1
- else:
- res = 0
- t = n ** 2
- for i in range(l - num + 1):
- res = t % 10
- t //= 10
- break
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement