fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. vector <long double> c;
  8. long double m, sum = 0, result = 1;
  9. while (cin >> m){
  10. c.push_back(m);
  11. }
  12. for (int i = 0; i < c.size()/2; i++){
  13. sum = c[i] + c[c.size() - 1 - i];
  14. result *= sum;
  15. }
  16. cout << result << endl;
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3464KB
stdin
1 2 3 4 5 6
stdout
343