|
|
вернуться в форумWhy I got Crash (FLT_INVALID_OPERATION) help me!!! Послано Badd 28 фев 2002 08:44 const inp = '1133.in'; maxgen = 2005; var fname : text; l,itemp : longint; i,j,to_,t : extended; ii,jj,tt : extended; f,ff : extended; gen : array[0..maxgen] of extended; procedure gendat; var l : longint; begin gen[0]:=0; gen[1]:=1; for l:=2 to maxgen do gen[l]:=gen[l-1]+gen[l-2]; end; procedure process; var temp : extended; begin t:=i; f:=ii; ff:=tt; while (t<>to_) do begin if t<to_ then begin temp:=f+ff; f:=ff; ff:=temp; t:=t+1; end else begin temp:=ff-f; ff:=f; f:=temp; t:=t-1; end; end; writeln(f:0:0); halt; end; begin readln(i,ii,j,jj,to_); if j<i then begin t:=i; tt:=ii; i:=j; ii:=jj; j:=t; jj:=tt; end; gendat; if gen[trunc(j-i-1)]*ii<jj then t:=1 else t:=-1; itemp:=trunc(abs((gen[trunc(j-i-1)]*ii)-jj)) div trunc(gen[trunc(j-i)]); tt:=itemp; tt:=tt*t; process; end. Re: Why I got Crash (FLT_INVALID_OPERATION) help me!!! i used to submit this problem and got WA i guess that u forget to think ordinary fibo(n) if(n>100) it can't keep in long Ho Ho ...........:-) > i used to submit this problem and got WA > > i guess that u forget to think ordinary fibo(n) > if(n>100) it can't keep in long |
|
|