fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin>>n;
  8. double x[n];
  9. for (int i=0; i<n; i++)//вводим массив
  10. cin>>x[i];
  11. double p=1;
  12. for (int i=0; i<n-2; i++)//подсчитываем необходимое произведение
  13. {
  14. p*=(x[i]+2*x[i+1]+x[i+2]);
  15. }
  16. cout<<p;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3432KB
stdin
6
1 1 1 1 1 1 
stdout
256