题解 | 三角形的边

三角形的边

https://www.nowcoder.com/practice/05dbd1cd43b24dbbae567b3e816d4e97?tpId=40&tags=&title=&difficulty=2&judgeStatus=0&rp=1&sourceUrl=

// 一行代码实现
#include <iostream>
using namespace std;
int min_add_mid_sub_max(int a, int b, int c) {
    return a > b ? (a > c ? (b + c) - a : (a + b) - c) : (b > c ? (a + c) - b :(a + b) - c);
}
int main() {
    int a, b, c;
    while (cin >> a >> b >> c) {
        cout << min_add_mid_sub_max(a, b, c) << endl;
    }
}

全部评论

相关推荐

大飞的诡术妖姬:之前看b站多明海有个说法,日本就业竞争非常低的原因不光是毕业学生少,还有很多人干两年不喜欢职场氛围就辞职躺平,位置也空了很多,论吃苦耐劳还得看咱们
点赞 评论 收藏
分享
06-11 13:34
门头沟学院 C++
offe从四面八方来:我真的没时间陪你闹了
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务