func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 100005;   double p[maxn], dp[maxn];   int n;   int main() {     int i;     while (scanf( %d , &n) != EOF) {       double ans = 0;       for (i = 1; i <= n; i++) {         scanf( %lf , &p[i]);         ans += p[i];       }       dp[0] = 0;       for (i = 1; i <= n; i++) {         dp[i] = dp[i - 1] * p[i] + p[i];         ans += (dp[i] - p[i]) * 2;       }       printf( %.7f n , ans);     }     return 0;   }   