Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- double a, b, c, n, m, k, x, s;
- int enternumbers() {
- std::cout << "wpisz wielomian w postaci ax^n+bx^m+cx^k" << '\n' << "podaj a" << '\n';
- std::cin >> a;
- std::cout << "podaj b" << "\n";
- std::cin >> b;
- std::cout << "podaj c" << "\n";
- std::cin >> c;
- std::cout << "podaj n" << "\n";
- std::cin >> n;
- std::cout << "podaj m" << "\n";
- std::cin >> m;
- std::cout << "podaj k" << "\n";
- std::cin >> k;
- std::cout << "podaj argument dla ktorego chcesz obliczyc wyrazenie" << "\n";
- std::cin >> x;
- std::cout << "twoje wyrazenie to" << a << x << "^" << n << "+" << b << x << "^" << m << "+" << c << x << "^" << k << "dla x = " << x << '\n';
- return 0;
- }
- int main(int argc, char const *argv[])
- {
- enternumbers();
- s=a*pow(x,n)+b*pow(x,m)+c*pow(x,k);
- std::cout << "wartosc wyrazenia wynosi = " << s <<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement