Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a,b:longint;
- function pow(a,b:longint):longint;
- begin
- if (b = 0) then pow:=1 else
- if (b mod 2 = 0) then pow:=sqr(pow(a,b shr 1)) else
- pow:=pow(a,b-1)*a
- end;
- Begin
- read(a,b);
- write(pow(a,b));
- end.
Advertisement
Add Comment
Please, Sign In to add comment