jifen

ykj48 流星雨 2023-07-27 17:34:11 1
#include <bits/stdc++.h>
using namespace std;
struct jifen{
	string name;
	int xiti;
	int kaoshi;
	int zong;
};
bool cmp(jifen a, jifen b){
	return a.zong>b.zong;
}

int main()
{
	int n;
	jifen a[12];
	string b[12]={"sdkn","谭可","刘立珩","肖化泽","张博渊","朱韬翰","侯俊喆","杨雅媛","袁彬蔚","廖淳翔","彭楷茏","胡智炫"};
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a[i].name=b[i];
	} 
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].xiti>>a[i].kaoshi;
		a[i].zong=(a[i].xiti*0.4)+(a[i].kaoshi*0.6);
		cout<<a[i].zong<<endl;
	}
	sort(a+1,a+1+n,cmp);
	cout<<endl<<endl<<"  个人积分榜"<<endl<<endl;
	for(int i=1;i<=n;i++)
	{
		cout<<i<<". "<<a[i].zong<<" "<<a[i].name<<endl;
	}
	return 0;
} 


{{ vote && vote.total.up }}