Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- double foo(double *px)
- {
- double sum = 0;
- for (int i = 1; i < 6; i++) {
- sum += exp(2 * cos(i * (*px))) * pow((*px), cos(i));
- }
- return sum;
- }
- int main()
- {
- double a = 0.25;
- for (double x = a; x < 0.81; x += 0.055) {
- cout << "x = " << x << " " << "sum = " << foo(&x) << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement