Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double calc(int i, double x){
- return pow(x, (2. / i)) + log(pow(x, i)) * sin(pow(x,i));
- }
- int main()
- {
- double y, fx1 = 0, fx2 = 0, fx3 = 0, x1 = 0.32, x2 = 8.5, x3 = 2;
- for (int i = 1; i <= 4; i++) {
- fx1 += calc(i, x1);
- fx2 += calc(i, x2);
- fx3 += calc(i, x3);
- }
- cout << "f(x1) = " << fx1 << ";\tf(x2) = " << fx2 << ";\tf(x3) = " << fx3 << ";" << endl;
- y = fx1 + fx2 * fx3;
- cout << y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement