fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a,b,c,d;
  7. cin >> a; cin >> b; cin >> c;
  8. d = a + (b * c);
  9. d = a * (b+c) > d ? a * (b+c) : d;
  10. d = a * b * c > d ? a*b*c : d;
  11. d = (a + b) * c > d ? (a + b) * c : d;
  12. d = a + b + c > d ? a+b+c : d;
  13. cout << d << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3344KB
stdin
5
1
3
stdout
20