C chshanghai Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-18 #3 笨方法 function xy(x,y):int64; var i:int begin if y>=1 then begin result=x for i:=1 to y-1 do result:=result*x end else begin ................ end; end;
笨方法 function xy(x,y):int64; var i:int begin if y>=1 then begin result=x for i:=1 to y-1 do result:=result*x end else begin ................ end; end;
S san_fish Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-18 #4 re ugvanxk:用power函数就行了 不同意chshanghai的“笨”方法,如果y为浮点数就没戏了
白 白河愁 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-18 #5 function power(n2,n1:integer):longint; var i:integer; s:longint; begin s:=1; for i:=1 to n2 do s:=s*n1; result:=s; end;
function power(n2,n1:integer):longint; var i:integer; s:longint; begin s:=1; for i:=1 to n2 do s:=s*n1; result:=s; end;
B boyi_cj Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-18 #10 san_fish 那么,如果是x的0.321次方应该怎么求呢?谢谢