南阳60

 #include<stdio.h>
#include<string.h>
int main()
{
    struct
    {
        char name[250];
        int qm;
        int by;
        char gb;
        char xb;
        int lw;
    } xx[205];
    int jxj[105],n,i,s,k,m;
    scanf("%d",&n);
    {
        while(n--)
        {
            memset(xx,0,sizeof xx);
            memset(jxj,0,sizeof jxj);
            scanf("%d",&m);
            for(i=s=k=0; i<m; ++i)
            {
                scanf("%s%d%d %c %c %d",xx[i].name,&xx[i].qm,&xx[i].by,&xx[i].gb,&xx[i].xb,&xx[i].lw);
                if(xx[i].qm>80 && xx[i].lw>0)
                    jxj[i]+=8000;
                if(xx[i].qm>85 && xx[i].by>80)
                    jxj[i]+=4000;
                if(xx[i].qm>90)
                    jxj[i]+=2000;
                if(xx[i].qm>85 && xx[i].xb=='Y')
                    jxj[i]+=1000;
                if(xx[i].by>80 && xx[i].gb=='Y')
                    jxj[i]+=850;
                if(jxj[i]>jxj[k])
                    k=i;
                s+=jxj[i];
            }
          //for(i=0; i<m; ++i)
            //    printf("%s*\n%d*\n%d*\n%c*\n%c*\n%d*\n",xx[i].name,xx[i].qm,xx[i].by,xx[i].gb,xx[i].xb,xx[i].lw);
                printf("%s\n%d\n%d\n",xx[k].name,jxj[k],s);
        }
    }
}
        

 

posted @ 2016-12-28 11:36  Posase  阅读(127)  评论(0编辑  收藏  举报