Skip to content

Instantly share code, notes, and snippets.

@rolisz
Created February 4, 2012 18:07
Show Gist options
  • Save rolisz/1739257 to your computer and use it in GitHub Desktop.
Save rolisz/1739257 to your computer and use it in GitHub Desktop.
Rezolvare problema 9 subiect FP
def pow(x,n):
if n==0: return 1
if n==1: return x
res = x
i = 2
while i<= n :
if 2*i < n:
res = res * res
res = res * x
i = i + 1
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment