PTA BASIC 1032.挖掘机技术哪家强

℡╲_俬逩灬. 提交于 2020-03-10 05:38:04

原题目链接


 中国山东找蓝翔

源码©

#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;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!