Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int MAX=100;
  4. double oblicz (double A[], double x, int n)
  5. {
  6. double w=A[0];
  7. for (int i=1;i<=n;i++)w=w*x+A[i];
  8. return w;
  9. }
  10. main ()
  11. {
  12. double A[MAX], x;
  13. int n;
  14. cout<<"podaj wartosc argumentu x: ";
  15. cin>>x;
  16. cout<<"podaj stopien wielomianu n: ";
  17. cin>>n;
  18. cout<<"podaj "<<n+1<<" wspolczynnikow wielomianu:"<<endl;
  19. for (int i=0;i<n;i++)
  20. {
  21. cout<<"A["<<i<<"] = ";
  22. cin>>A[i];
  23. }
  24. cout<<"iteracyjnie: wynik = "<<oblicz(A,n,x)<<endl;
  25. system ("pause");
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement