Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double k,x;
- cout<<"x=";cin>>x;
- cout<<"k=";cin>>k;
- double b=x*x*x;
- double p=1.0;
- for (int n=2;n<=k;n++)
- {
- p*=1.0+b/(n*n*n-1.0);
- b*=-x*x;
- }
- cout<<"p="<<p<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment