Logo GNU
Kodovani P°edchozφ Nßsledujφcφ Obsah

33. Testovacφ program pro Pascal

{$N+,S-,R-,Q-,I-,G+,B-}
program formulas;
uses dos;
var
 maxiter:longint;
 h1,h2,m1,m2,s1,s2,u1,u2:word;

function mand_calc(cre,cim,pre,pim:double):integer;
var
  rp,ip,zre,zim:double;
  iter:longint;
begin
  zre := cre;
  zim := cim;
  iter := maxiter;
  while ((iter>0) and (rp + ip < 4)) do begin
            ip := (zim * zim);
            zim := (zim * zre) * 2 + pim;
            rp := (zre * zre);
            zre := rp - ip + pre;
            DEC(iter);
  end;
   iter := maxiter - iter;
   mand_calc:=iter;
end;
begin
 maxiter:=10000000;
   GetTime(h1,m1,s1,u1);
   mand_calc(0,0,0,0);
   GetTime(h2,m2,s2,u2);
   writeln (((maxiter)/(u2-u1+(s2-s1)*100+(m2-m1)*60000))*100:8:2);
end.


P°edchozφ Nßsledujφcφ Obsah

Dotazy a p°ipomφnky ohledn∞ strßnky posφlejte na hubicka@paru.cas.cz