Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Teylor;
- var n: integer;
- toch, x, prev, itog, p: real;
- begin
- itog := 0;
- p := 1;
- write('Синус - 1, косинус - 2: ');
- readln(n);
- write('Угол: ');
- readln(x);
- write('Точность: ');
- readln(toch);
- if n = 1 then begin
- prev := x;
- itog := itog + prev;
- while prev >= toch do begin
- prev := prev * (((-1)*(x*x))/((p+1)*(p+2)));
- p := p+2;
- itog := itog + prev;
- end;
- end
- else begin
- p := 0;
- prev := 1;
- itog := itog + prev;
- while prev >= toch do begin
- prev := prev * (((-1)*(x*x))/((p+1)*(p+2)));
- p := p+2;
- itog := itog + prev;
- end;
- end;
- write('Ответ: ');
- writeln(itog);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement