Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. double oblicz (double A[],int n,double x)
  4. {
  5. if(n==0)return A[0];
  6. if(n>0)return oblicz (A,n-1,x)*x+A[n];
  7. }
  8. main()
  9. {
  10. double x;
  11. cout<<"Podaj system: ";
  12. cin>>x;
  13. int n;
  14. cout<<"Podaj ilość elementów tablicy: ";
  15. cin>>n;
  16. double A[n];
  17. for(int i=0;i<n;i++){cout<<"Podaj wartosc tablicy: "; cin>>A[i];}
  18. if(x>=2 && x<=9)
  19. {
  20. cout<<oblicz(A,n-1,x);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement