Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include<iostream>
  3. #include<conio.h>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int i = 2, n;
  8. double x;
  9. int *polArray = new int[n + 1];
  10. void cpocob1() {
  11. polArray[0] = 0;
  12. polArray[1] = 2 * x;
  13. for (i = 2; i<(n); i++)
  14. {
  15. polArray[i] = 2 * x*polArray[i - 1] - 2 * (i - 1)*polArray[i - 2];
  16.  
  17. }
  18. }
  19.  
  20. int main()
  21. {
  22. setlocale(LC_ALL, "Russian");
  23. double n; double x;
  24. cout << "введи n" << endl;
  25. cin >> n;
  26. cout << "введи x" << endl;
  27. cin >> x;
  28. cpocob1();
  29. cout << "интеративный полином=" << polArray[i] << endl;
  30. system("pause");
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement