Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <math.h>
- using namespace std;
- double i,n;
- int wartosc[100];
- double x;
- int licz(int i) {
- if (i == 0)
- return wartosc[0];
- else
- return licz(i-1) * x + wartosc[i];
- }
- int main() {
- cout<<"Podaj stopien wielomianiu: "<<endl;
- cin>>n;
- cout<<"Podaj wartosci a:"<<endl;
- for (int i=0;i<=n;i++) {
- cout<<"a("<<i<<") = ";
- cin>>wartosc[i];
- }
- cout<<endl<<"Podaj x: ";
- cin>>x;
- cout<<endl<<"Wynik to: "<<licz(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment