洛谷 [语言月赛 202508] 航班延误 题解

这道题很简单,就只需要几个if判断一下是在哪个价位即可
代码展示:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,a,b,c;
    cin>>x>>a>>b>>c;
    if(x<60)cout<<0;
    else if(x>=60&&x<120)cout<<a;
    else if(x>=120&&x<240)cout<<b;
    else cout<<c;
    return 0;
}
posted @ 2025-08-25 13:59  CCCsuper  阅读(17)  评论(0)    收藏  举报
萌ICP备20256293号