洛谷 [语言月赛 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;
}

浙公网安备 33010602011771号