SHARE
TWEET

Untitled

a guest Oct 10th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std ;
  3. typedef double real;
  4. typedef int intreg;
  5. real vP(intreg,real*,real); //declaratia functiei
  6. int main ()
  7. {
  8.     int grad=3;
  9.     real coeffs[]={1.1222,1.2122,1.3211,1.6233},
  10.             point=1;
  11.     cout <<vP(grad,coeffs,point)<<endl;
  12.     return 0;
  13. }
  14. //definitia fct/corpul
  15. real vP (intreg grad, real coeffs[], real point)
  16. {
  17.     real s;
  18.     int i;
  19.     s = coeffs[grad]; /*coef[n]*/
  20.     for(i=grad-1; i>=0; i--)
  21.         s=s*point+coeffs[i];
  22.     return s;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top