题解 | 彩虹糖的梦

彩虹糖的梦

https://www.nowcoder.com/practice/1d8e370f4e6a43f89203ae616ededfdb?channelPut=w25springcamp

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
int main() {
    int mi=INT_MAX;
    for(int i=0;i<7;i++)
    {
        int t;
        cin>>t;
        mi=min(mi,t);
    }
    cout<<mi;
    return 0;
}
// 64 位输出请用 printf("%lld")

通过题目不难发现,我们只需要输出最小值即为最后答案,类似于木桶理论。

#牛客春招刷题训练营#
全部评论

相关推荐

点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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