fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double mul = 1; //Произведение
  6. double x;
  7. while(cin >> x && x>=0) mul *= x;
  8. cout << mul;
  9. return 0;
  10. }
Success #stdin #stdout 0s 3432KB
stdin
1 2 3 4 3 2 1 -1
stdout
144