codeforces水题100道 第八题 Codeforces Round #274 (Div. 2) A. Expression (math)

题目链接:http://www.codeforces.com/problemset/problem/479/A
题意:给你三个数a,b,c,使用+,*,()使得表达式的值最大。
C++代码:

#include <iostream>
using namespace std;
int a, b, c, ans;
int main()
{
    cin >> a >> b >> c;
    int t = max(a+b, a*b);
    ans = max(t + c, t * c);
    t = max(b+c, b*c);
    t = max(a+t, a*t);
    ans = max(ans, t);
    cout << ans;
    return 0;
}
C++
原文地址:https://www.cnblogs.com/moonlightpoet/p/5688917.html