满级题解(P1085)

· · 题解

管理员千万不要来看,看了也别封号。这篇题解纯属是为了娱乐。

以下是内容。

#include<iostream>
#include<algorithm>
using namespace std;
struct luogu_team
{
    int kkksc03,noip,lin_toto,chen_zhe;
}a[7];
bool y(luogu_team x,luogu_team z)
{
    if(x.lin_toto==z.lin_toto) return x.chen_zhe<z.chen_zhe;
    return x.lin_toto>z.lin_toto;
}
int main()
{
    for(int i=0;i<7;i++)
    {
        cin>>a[i].kkksc03>>a[i].noip;
        a[i].lin_toto=a[i].kkksc03+a[i].noip;
        a[i].chen_zhe=i+1;
    }
    sort(a,a+7,y);
    if(a[0].lin_toto>8) cout<<a[0].chen_zhe;
    else cout<<0;
    return 0;
}