Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # _*_ coding: utf-8 _*_
- def quick(qstepen, i):
- if id == 1:
- if i < n:
- qstepen *= (a*a)
- quick(qstepen, i + 1)
- else:
- print (qstepen)
- elif id == 2:
- if i < n:
- qstepen *= a
- quick(qstepen, i + 1)
- else:
- print (qstepen * a)
- a = int(input())
- n = int(input())
- i = 1
- if n % 2 == 0:
- n //= 2
- qstepen = (a*a)
- id = 1
- elif n % 2 == 1:
- n -= 1
- qstepen = a
- id = 2
- quick(qstepen, i)
Advertisement
Add Comment
Please, Sign In to add comment