|
|
back to boardi thing problem not in longint no inaf Posted by zzzlll 3 Jan 2007 22:26 you can look var a1,a0,p:extended; n,k,i:extended; begin readln(n,k); a1:=k-1; i:=1; {for i:=2 to n do begin } repeat i:=i+1; p:=a1; a1:=(a1+a0)*(k-1); a0:=p; until i>=n; {end; } writeln(a1+a0:0:0); end. You way are currect but you MUST use HI-precision You way are currect but you MUST use HI-precision |
|
|