fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double x, y, z;
  6. double a, b;
  7. cin >> x >> y >> z;
  8. a = x + y + z;
  9. b = x * y * z;
  10. //max (x + y + z, xyz)
  11. if (a > b) {
  12. cout << a <<endl;
  13. }
  14. else cout << b << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3476KB
stdin
-23 56 7 
0 1 125
2 2 1
2 5 6
stdout
40