bawang51吧 关注:31贴子:3,169
  • 0回复贴,共1

【OI】快速幂

只看楼主收藏回复

var
a,n,t:qword;
begin
readln(a,n);
t:=a;
a:=1;
while n>0 do
begin
if n and 1=1 then
a:=a*t;
n:=n shr 1;
if n<=0 then
break;
t:=t*t;
end;
writeln(a);
end.


IP属地:上海1楼2012-07-17 20:36回复