The practice of a school is to grant scholarships after the final exams of each semester. There are five scholarships issued, and the conditions for obtaining them are different:
1) Academician scholarship, 8000 yuan per person, the end of the average score of more than 80 points (>80), and in this semester published 1 or more than 1 papers students can be obtained;
2) May Fourth Scholarship, 4000 yuan per person, the end of the average score is higher than 85 points (>85), and the class appraisal result is higher than 80 (>80) students can be obtained;
3) Outstanding Achievement Award, 2000 yuan per person, students who have a final average score above 90 (>90) can be obtained;
4) Western Scholarship, 1000 yuan per person, and students from western provinces with a final average score above 85 (>85);
5) Class Contribution award, 850 yuan per person, the class appraisal result is higher than 80 points (>80) student cadres can be obtained;
As long as the criteria are met, there is no limit to the number of winners for each scholarship, and a number of scholarships are available for each student. For example, Yiao Lin's end-of-term average is 87 points, Class review score 82 points, and he is a student cadre, then he can also receive May Fourth Scholarship and Class contribution award, the total bonus is 4850 yuan.
Now give the relevant data for several students, please calculate which students get the highest total bonus (assuming that the students can meet the conditions for the scholarship).
ChenRuiyi900028700
1 /*December 7, 2016 Openjudge daily water problem2 ———— 1.9.4 by Lxzy_zby*/3#include <cstdio>4#include <algorithm>5#include <cstring>6 using namespacestd;7 structSt//Define structure Body8 {9 Charname[ A];Ten intl; One intC; A CharSG; - Charxst; - intLUNs; the intlist; - intMon; - }; - intMoney (St a)//statistics and calculation of the total scholarship received by each person + { - if(a.l> the&&a.lun>=1) +a.mon+=8000; A if(a.l> -&&a.c> the) ata.mon+=4000; - if(a.l> -) -a.mon+= -; - if(a.l> -&&a.xst=='Y') -a.mon+= +; - if(a.c> the&&a.sg=='Y') ina.mon+=850; - returnA.mon; to } + intMain () - { the intN; *scanf"%d", &n);//input has n students $St M[n];//Defining N St StructuresPanax Notoginseng for(intI=0; i<n;i++) - { thescanf"%s%d%d%c%c%d", M[i].name,&m[i].l,&m[i].c,&m[i].sg,&m[i].xst,&m[i].lun);//enter data for each student +m[i].list=i+1;//load Each student's number Am[i].mon=0;//Initialize each person's bonus amount theM[i].mon=money (M[i]);//Call the Money function to count everyone's bonuses + } - intx=m[0].mon,y=0, o=0;//y is the maximum number of bonuses, O is initialized for the total bonus number, X is the maximum bonus $ for(intI=0; i<n;i++) $ { - if(x<M[i].mon) - { they=i; -x=M[i].mon;Wuyi } theo+=M[i].mon; - Wu } -printf"%s\n%d\n%d", m[y].name,x,o); About return 0; $}