SHARE
TWEET

sdasda

a guest Sep 16th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. void Dane(int &m, float tab_wsp[], float &xx)
  7. {
  8.     cout<<"Podaj stopien wielomianu: ";
  9.     cin>>m;
  10.     cout<<"Podaj kolejno wspolczynniki: "<<endl;
  11. }
  12.     for (int i=0 ; i<=m; i++)
  13.     {
  14.         cout <<"a"<<i<<"=";
  15.         cin>> tab_wsp[i];
  16.     }
  17.     cout<<"Podaj wartosc x=";
  18.     cin>>xx;
  19. }
  20.  
  21. float Horner(int &m, float tab_wsp[], float xx)
  22. {
  23.     int i;
  24.     float wartosc = tab_wsp[0];
  25.     for(int i=0; i<=k; i++)
  26.         wartosc=wartosc*xx+tab_wsp[i];
  27. return wartosc;    
  28. }
  29. float wsp[20];
  30. float x,w;
  31. int n;
  32.  
  33.  
  34. int main()
  35. {
  36.    Dane(n,wsp,x);
  37.    w=Horner(n,wsp,x);
  38.    cout<<"w"<<"("<<x<<") = " <<w;
  39.    
  40.  
  41.     return 0;
  42. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top