Friday, May 27, 2011

12015 - Google is Feeling Lucky


#include<stdio.h>

struct List
{
    char name[105];
    int rel;
};

int main()
{
    register int t,i,k,mx;
    struct List lst[10];
    //freopen("in.txt","r",stdin);

    scanf("%d\n",&t);
    for(k=1;k<=t;k++)
    {
        mx = 0;
        for(i=0;i<10;i++)
        {
            scanf("%s%d",lst[i].name,&lst[i].rel);
            if(mx<lst[i].rel)
                mx = lst[i].rel;
        }
        printf("Case #%d:\n",k);

        for(i=0;i<10;i++)
            if(lst[i].rel == mx)
                printf("%s\n",lst[i].name);
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.