PATB1032

利用school[MANX]记录相应学习的总分
使用枚举MAX记录shcool[i]最高并打印
#include 
#include 
#define MANX 100
int main()
{
    int school[MANX],N,i,s,MAX,k,score;
    memset(school,0,sizeof school);
    scanf("%d",&N);
    for(i=1;i<=N;i++){
        scanf("%d %d",&s,&score);
        school[s]=school[s]+score;
    };
    for(i=1;ischool[i-1])
            { MAX=school[i];k=i;
            }
    }
    printf("%d %d",k,MAX);
    return 0;
}

你可能感兴趣的:(PATB1032)