Advertisement
takeuchuha

1 laba

Dec 15th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. double calc(int i, double x){
  4. return pow(x, (2. / i)) + log(pow(x, i)) * sin(pow(x,i));
  5. }
  6. int main()
  7. {
  8. double y, fx1 = 0, fx2 = 0, fx3 = 0, x1 = 0.32, x2 = 8.5, x3 = 2;
  9. for (int i = 1; i <= 4; i++) {
  10. fx1 += calc(i, x1);
  11. fx2 += calc(i, x2);
  12. fx3 += calc(i, x3);
  13. }
  14. cout << "f(x1) = " << fx1 << ";\tf(x2) = " << fx2 << ";\tf(x3) = " << fx3 << ";" << endl;
  15. y = fx1 + fx2 * fx3;
  16. cout << y;
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement