二年级小学生求助,重发,哪错了??

P1093 [NOIP2007 普及组] 奖学金

神贴搬运工 @ 2020-07-31 13:27:36

#include<bits/stdc++.h>
using namespace std;
struct node
{
    int x1,x2,x3,zong,id;
}a[1001];
bool cmp(node x,node y)
{
    if(x.zong!=y.zong)
    {
        return x.zong>y.zong;
    }
    else
    {
        return x.id<y.id;
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    int n,i;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i].x1>>a[i].x2>>a[i].x3;
        a[i].id=i;
        a[i].zong=a[i].x1+a[i].x2+a[i].x3;
    }
    sort(a+1,a+n+1,cmp);
    for(i=1;i<=5;i++)
    {
        cout<<a[i].id<<" "<<a[i].zong<<"\n";
    }
}

by MilkyCoffee @ 2020-07-31 14:12:43

小二我还在学scratch


by MegaMay @ 2020-07-31 14:18:49

长江后浪推前浪~


by MegaMay @ 2020-07-31 14:19:27

struct我初二才会


by L_sdcs @ 2020-07-31 14:26:04

+1


by GoldenFishX @ 2020-07-31 15:06:32

二年级就比我强,爬走了/kk


by GoldenFishX @ 2020-07-31 15:06:39

wtcl/kk


by EDqwq @ 2020-07-31 17:20:41

stOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 如果我小二开始学我已经AKIOI了


by Ex90r @ 2020-08-04 20:16:06

@神贴搬运工 小二就学OI还学的不错了,不像窝小五(现小六升初一)才有您这样的水平,您太强了%%%


by Ex90r @ 2020-08-04 20:18:31

@牛奶小咖啡 杠精:您启蒙太晚了,scratch不是小一学的吗

P.S.请您别动肝火


by MilkyCoffee @ 2020-08-04 20:21:20

@TLE自动机_ 窝小五才能拿到pj2,惭愧


上一页 | 下一页