Advertisement
Guest User

2135234

a guest
Oct 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // 123.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <math.h>
  6. #include <iostream>
  7.  
  8. using namespace std;
  9.  
  10.  
  11. int _tmain(int argc, _TCHAR* argv[])
  12. {
  13. int k, i, p, u, m;
  14. double s=0, w;
  15. cout << "k= ";
  16. cin >> k;
  17. for (i=1; i<=k; i++)
  18. {
  19. for (u=i; u<=i; u++)
  20. {
  21. m=i+1;
  22. p *= m;
  23. }
  24. if (i=2)
  25. w=0;
  26. else
  27. w = pow(-1., i)*p/(i*i-4);
  28.  
  29. s+=w;
  30.  
  31.  
  32. }
  33. cout << "w= " << s << endl;
  34. system("pause");
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement