func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     double ans, p, q, p1, p2, p3;     int n, i;     scanf( %d , &n);     ans = 0.0;     q = p2 = p3 = 1;     p1 = 0;     for (i = 1; i <= n + 1; i++) {       if (i <= n)         scanf( %lf , &p);       else         p = 0.0;       ans += (1 - p) * p1;       p1 = (p1 + p2) * p;       q = 1.0 - p;       p2 = (p2 + 2.0 * p3) * p + q;       p3 = p3 * p + q;     }     printf( %.15f n , ans);     return 0;   }   