Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- q = int(input())
- p = int(input())
- n = int(input())
- pp = p
- res = 0
- i = 0
- while n:
- res += (n % 10) * p**i
- i += 1
- n = n // 10
- n = res
- p = q
- res = ''
- while n >= p:
- res = str(n % p) + res
- n = n // p
- res = str(n) + res
- print(res)
- n = int(input())
- p = q
- res = 0
- i = 0
- while n:
- res += (n % 10) * p**i
- i += 1
- n = n // 10
- n = res
- res = ''
- p = pp
- while n >= p:
- res = str(n % p) + res
- n = n // p
- res = str(n) + res
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment