fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. double k=1;
  9. cin>>n;
  10. double x[n];
  11. for(int i=0;i<n;i++)
  12. {
  13. cin>>x[i];
  14. }
  15. for(int i=1;i<n;i++)
  16. {
  17. k*=((1/(fabs(x[i-1])+1))+x[i]);
  18. }
  19. cout<<k;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3432KB
stdin
3
-0.3 1 -0.5
stdout
Standard output is empty