• API
• FAQ
• Tools
• Archive
daily pastebin goal
42%
SHARE
TWEET

# Untitled

a guest Nov 9th, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #include <iostream>
2. #include <cmath>
3. double a, b, c, n, m, k, x, s;
4.
5. int enternumbers() {
6.     std::cout << "wpisz wielomian w postaci ax^n+bx^m+cx^k" << '\n' << "podaj a" << '\n';
7.     std::cin >> a;
8.     std::cout << "podaj b" << "\n";
9.     std::cin >> b;
10.     std::cout << "podaj c" << "\n";
11.     std::cin >> c;
12.     std::cout << "podaj n" << "\n";
13.     std::cin >> n;
14.     std::cout << "podaj m" << "\n";
15.     std::cin >> m;
16.     std::cout << "podaj k" << "\n";
17.     std::cin >> k;
18.     std::cout << "podaj argument dla ktorego chcesz obliczyc wyrazenie" << "\n";
19.     std::cin >> x;
20.     std::cout << "twoje wyrazenie to" << a << x << "^" << n << "+" << b << x << "^" << m << "+" << c << x << "^" << k << "dla x = " << x << '\n';
21.     return 0;
22. }
23.
24. int main(int argc, char const *argv[])
25. {
26.     enternumbers();
27.         s=a*pow(x,n)+b*pow(x,m)+c*pow(x,k);
28.     std::cout << "wartosc wyrazenia wynosi = " << s <<"\n";
29.     return 0;
30. }
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.

Top