老斯不在,譛无语.....复制代码到电脑会吓你一跳(报错信息)
查看原帖
老斯不在,譛无语.....复制代码到电脑会吓你一跳(报错信息)
996202
audvnj楼主2023/7/19 12:25
#include<bits/stdc++.h>
using namespace std;
int n[301];
struct qwert
{
	int x;
	int y;
	int s;
	int e;
	int z(){
		return y+s+e;
	}
};
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	qwert a;
	int b;
	cin>>b;
	for(int i=1;i<=b;i++)
	{
		cin>>a.x >>a.y >>a.s>>a.e;
	}
	for(int i=1;i<=b;i++)
	{
		sort(a.z(),a.z(),cmp);
	}
	for(int i=1;i<=b;i++)
	{
		cout<<a.x <<' '<<a.z() ;
	}
}
2023/7/19 12:25
加载中...