Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Uses crt;
- Type mas = array Of real;
- Function Gorner(arr:mas; x:real; n:byte): real;
- Var f,s: real;
- i: byte;
- Begin
- f := 1;
- s := arr[n];
- For i := 1 To n Do Begin
- f := f * x;
- s := s + arr[n - i] * f;
- End;
- Gorner := s;
- End;
- Var i,n: byte;
- x: real;
- arr: mas;
- Begin
- clrscr;
- write('Введите n=');
- readln(n);
- SetLength(arr, n + 1);
- write('Введите x=');
- readln(x);
- writeln('Введите ', n + 1, ' коэфф. многочлена степени ', n);
- For i := 0 To n Do
- read(arr[i]);
- write('S=', Gorner(arr, x, n):0:6);
- readln;
- End.
Advertisement
Add Comment
Please, Sign In to add comment