90我要峰了
查看原帖
90我要峰了
1053122
shy_lihui楼主2024/4/29 22:36
//#include<bits/stdc++.h>
#include<iostream>
#include<math.h>
#include<cstring>
#include<string.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<stdio.h>
using namespace std;
int n;
int ans;
struct student
{
	string name;//名字
	int sum;//期末平均成绩
	int cnt;//班级评议成绩
	char c1;//是否是学生干部
	char c2;//是否是西部省份学生
	int num;//发表的论文数
	int jxjj;//奖学金 
}a[105];
bool cmp(student x,student y)
{
	return x.jxjj>y.jxjj;
}
bool ys(student x)//院士奖学金
{
	return x.sum>80&&x.num!=0;
}
bool ws(student x)//五四奖学金
{
	return x.sum>85&&x.cnt>80;
}
bool yx(student x)//成绩优秀奖
{
	return x.sum>90;
}
bool xb(student x)//西部奖学金
{
	return x.sum>85&&x.c2=='Y';
}
bool gx(student x)//班级贡献奖
{
	return x.cnt>80&&x.c1=='Y';
}
int jxj(student y)//总奖学金 
{
	int ans=0;
	if(ys(y))ans+=8000;
	if(ws(y))ans+=4000;
	if(yx(y))ans+=2000;
	if(xb(y))ans+=1000;
	if(gx(y))ans+=850;
	return ans;
}
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i].name>>a[i].sum>>a[i].cnt>>a[i].c1>>a[i].c2>>a[i].num;
		a[i].jxjj=jxj(a[i]);
	}
	sort(a,a+n,cmp);
	cout<<a[0].name<<endl<<a[0].jxjj<<endl;
	for(int i=0;i<n;i++)
	{
		ans+=a[i].jxjj;
	}
	cout<<ans;
	return 0;
}
2024/4/29 22:36
加载中...