Skip to content

Instantly share code, notes, and snippets.

@showyou
Created June 23, 2018 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save showyou/cac6c67385fc2755f1ba4c236971d97f to your computer and use it in GitHub Desktop.
Save showyou/cac6c67385fc2755f1ba4c236971d97f to your computer and use it in GitHub Desktop.
K = input()
h = int(K)
i = 0
num = 1
while h > 0:
i += num
if i >= 9: num = 10
if i >= 99: num = 100
if i >= 999: num = 1000
if i >= 9999: num = 10000
if i >= 99999: num = 100000
if i >= 999999: num = 1000000
if i >= 9999999: num = 10000000
if i >= 99999999: num = 100000000
if i >= 999999999: num = 1000000000
if i >= 9999999999: num = 10000000000
if i >= 99999999999: num = 100000000000
if i >= 999999999999: num = 1000000000000
if i >= 9999999999999: num = 10000000000000
if i >= 99999999999999: num = 100000000000000
if i >= 999999999999999: num = 1000000000000000
if i >= 9999999999999999: num = 10000000000000000
if i > pow(10, 15): break
print(i)
h -= 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment