题解 | 学生综合评估系统
学生综合评估系统
https://www.nowcoder.com/practice/d8d5d6294b8f48b684ea93fbb4935a2b
#include<bits/stdc++.h>
using namespace std;
// 定义学生结构体
struct ss{
int id;
int a;
int b;
};
// 评估函数:判断学生是否优秀
bool kk(ss ab){
int s=ab.a*0.7+ab.b*0.3;
if(ab.a+ab.b>140 && s>=80){
return true;
}
else{
return false;
}
}
//主函数用于读入数据调用函数,请勿修改
int main(){
int n;
cin >> n;
ss ab;
for(int i=1;i<=n;i++){
cin >> ab.id >> ab.a >> ab.b;
if (kk(ab)) cout << "Excellent\n";
else cout << "Not excellent\n";
}
return 0;
}


查看8道真题和解析