- 谁拿了最多奖学金
- 2015-09-23 21:20:46 @
var
mindan:array[1..100]of string;
money:array[1..100]of integer;
minzi,zuiduo:string;
n,i,a,b,e,t:longint;
c,d:char;
begin
readln(n);
t:=0;
for i:=1 to n do
begin
read(minzi,a,b,c,d,e);
mindan[i]:=minzi;
if (e>=1) and (a>80) then t:=t+8000;
if (a>85) and (b>80) then t:=t+4000;
if (a>90) then t:=t+2000;
if (a>85) and (d='Y') then t:=t+1000;
if (b>80) and (c='Y') then t:=t+850;
money[i]:=t;
t:=0;
end;
for i:=1 to n-1 do
if money[i]>money[i+1] then
begin
zuiduo:=mindan[i];
t:=money[i];
end
else if (money[i]=money[i+1]) and (money[i]>t) then
begin
zuiduo:=mindan[i];
t:=money[i];
end;
writeln(zuiduo);
writeln(t);
t:=0;
for i:=1 to n do
t:=t+money[i];
writeln(t);
end.