Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 123.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <math.h>
- #include <iostream>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int k, i, p, u, m;
- double s=0, w;
- cout << "k= ";
- cin >> k;
- for (i=1; i<=k; i++)
- {
- for (u=i; u<=i; u++)
- {
- m=i+1;
- p *= m;
- }
- if (i=2)
- w=0;
- else
- w = pow(-1., i)*p/(i*i-4);
- s+=w;
- }
- cout << "w= " << s << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement