中国山东找蓝翔
源码©
#include<stdio.h>
int main()
{ int N,max=0;
scanf("%d",&N);
int school[100001]={0},num,score;
for(int i=0;i<N;i++) /*read and calucate*/
{ scanf("%d%d",&num,&score);
school[num]+=score;
}
for(int i=1;i<=N;i++) /*find the school own highest scores*/
{ if(school[i]>school[max])
{ max=i; }
}
printf("%d %d",max,school[max]);
return 0;
}
来源:CSDN
作者:渊澄
链接:https://blog.csdn.net/yuancheng224/article/details/104756986