- 谁拿了最多奖学金
- 2016-10-27 11:02:12 @
var best,name:string[20];
qimo,py,maxta,tal,i,n,ta,j,lunw:longint;
gb,xb:char;
procedure readin;
var q:char;
begin
name:='';
for j:=1 to 20 do
begin
read(q);
if q<>' ' then
name:=name+q
else break;
end;
end;
begin
assign(input,'scholar9.in');assign(output,'schola.out');
reset(input);rewrite(output);
readln(n);
maxta:=0;
tal:=0;
for i:=1 to n do
begin
readin;
ta:=0;
read(qimo,py);read(gb);read(gb);read(xb);read(xb);
read(lunw);
readln;
if (qimo>80)and(lunw>=1) then inc(ta,8000);
if (qimo>85)and(py>80) then inc(ta,4000);
if (qimo>90) then inc(ta,2000);
if (qimo>85)and(xb='Y') then inc(ta,1000);
if (py>80)and(gb='Y') then inc(ta,850);inc(tal,ta);
if ta>maxta then
begin
maxta:=ta;
best:=name;
end;
end;
writeln(best);
writeln(maxta);
writeln(tal);
close(input);close(output);
end.