home *** CD-ROM | disk | FTP | other *** search
- program t7;
- const eps=1e-14;
- var x,sx,s,t:real;
- i,k,n:integer;
- begin
- writeln('compute cosinus');
- write ('n:=');read(n);
- for i:=1 to n do begin
- read(x);
- t:=1; k:=0; s:=1; sx:=sqr(x);
- while abs(t)>eps*abs(s) do begin
- k:=k+2;
- t:=-t*sx/(k*(k-1));
- s:=s+t
- end;
- writeln(x,' ',s,' ',k div 2);
- end;
- end.
-