以下の内容はhttps://blog.hamayanhamayan.com/entry/2019/08/14/131203より取得しました。


+-x [AtCoder Beginner Contest 137 A]

https://atcoder.jp/contests/abc137/tasks/abc137_a

解説

https://atcoder.jp/contests/abc137/submissions/6894152

A+B,A-B,A*Bのうち最大の数を答えればいい。
C++のmaxだと2つの比較になるが、{}で与えてやるとリストで渡してくれるので、複数個の比較ができる。

int A, B;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B;

    int ans = max({ A + B, A - B, A * B });

    cout << ans << endl;
}



以上の内容はhttps://blog.hamayanhamayan.com/entry/2019/08/14/131203より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14