Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll a, b, c;
cin>>a>>b>>c;
ll max = -1;
ll arr[] = {(a*b*c), (a + b + c), (a + b * c), (a * b + c), ((a +b)*c), (a*(b + c))};
for(auto i : arr){
max = (i > max) ? i : max;
}
cout<<max<<endl;
}
Copy The Code &
Try With Live Editor
Input
1
2
3
2
3
Output
9
Demonstration
Codeforcess Solution 479-A A. Expression ,C++, Java, Js and Python ,479-A,Codeforcess Solution