挖掘机技术哪家强
作者:互联网
#include<stdio.h>
#include<string.h>
#define MAXN 100001
int main()
{
int n, schID, score;
scanf("%d", &n);
int school[MAXN];
memset(school, 0, sizeof(school));
for(int i = 0; i < n; i ++)
{
scanf("%d %d", &schID, &score);
school[schID] += score;
}
int MaxschID = 1, Max = -1;
for(int i = 1; i <= n; i ++)
if(Max < school[i])
{
Max = school[i];
MaxschID = i;
}
printf("%d %d\n", MaxschID, Max);
return 0;
}
标签:school,MaxschID,int,Max,哪家,技术,schID,score,挖掘机 来源: https://blog.csdn.net/z_x_y_zxy/article/details/112282262