如果 是激活的,那么得分取决于 的分数,所以先判定 的激活情况,看是否满足 并且 ,如果成立,直接输出 的值。
如果 未激活,就看 和 是否有激活的:
- 和 都激活,输出两个之中的较小值。
- 只有 激活,输出 。
- 只有 激活,输出 。
- 和 都没激活,输出 。
AC Code
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int a,b,c;
cin>>a>>b>>c;
if(a<=70 and a>=30) cout<<a;
else if((b<=70 and b>=30) and (c<=70 and c>=30)) cout<<min(b,c);
else{
if(b<=70 and b>=30) cout<<b;
else if((c<=70 and c>=30)) cout<<c;
else cout<<0;
}
return 0;
}
注:本题解在官方题解上进行了一些改编。
暂无评论