Advertisement
Guest User

Интеграл

a guest
Dec 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <cmath>
  2. #include <iostream>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8. // ввод
  9. int n;
  10. n = 20;
  11. //cin >> n;
  12. int **a = new int*[n];
  13. for (int i = 0; i < n; i++){
  14. a[i] = new int[n];
  15. }
  16.  
  17. // тело программы
  18. // Удалить все минимумы из массива
  19.  
  20. a[0][0] = 1;
  21. a[1][0] = 1;
  22. a[1][1] = 1;
  23. for (int i = 2; i < 20 ; i++){
  24. a[i][0] = 1;
  25. for (int j = 1; j < i; j++) {
  26. a[i][j] = a[i-1][j] + a[i-1][j-1];
  27. }
  28. a[i][i] = 1;
  29. }
  30. cin >> n;
  31. double *b = new double[n];
  32. for (int i = 0; i < n; i++){
  33. cin >> b[i];
  34. }
  35. for (int i = n; i > 0 ; i--){
  36. b[i] = b[i-1] / i ;
  37. }
  38. cout << "C ";
  39. for ( int i = 1; i <= n ; i++){
  40. cout << b[i] << ' ';
  41. }
  42. // вывод массива
  43. cout << endl;
  44. for (int i = 0; i < n; i++){
  45. for (int j = 0; j <= i ; j++){
  46. cout << a[i][j] << ' ';
  47. }
  48. cout << endl;
  49. }
  50. system("pause");
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement