- 谁拿了最多奖学金
- 2009-08-06 20:52:06 @
var
s,m,bgb,xb,mz:string;
qm,pj,lw,i,max,h,n:longint;
z:array[1..100] of longint;
procedure doing(s:string);
var
i,o,l:longint;
a:array[1..2000] of integer;
begin
o:=0;
fillchar(a,sizeof(a),0);
l:=length(s);
for i:=1 to l do
if s[i]=' ' then begin
inc(o);
a[o]:=i;
end;
m:=copy(s,1,a[1]-1);
val(copy(s,a[1]+1,a[2]-a[1]-1),qm);
val(copy(s,a[2]+1,a[3]-a[2]-1),pj);
bgb:=s[a[3]+1];
xb:=s[a[4]+1];
val(copy(s,a[5]+1,l-a[5]),lw);
end;
begin
readln(n);
for i:=1 to n do
begin
readln(s);
doing(s);
if (qm>80) and (lw>=1) then z[i]:=z[i]+8000;
if (qm>85) and (pj>80) then z[i]:=z[i]+4000;
if qm>90 then z[i]:=z[i]+2000;
if (qm>85) and (xb='Y') then z[i]:=z[i]+1000;
if (pj>80) and (bgb='Y') then z[i]:=z[i]+850;
h:=h+z[i];
if z[i]>max then begin
max:=z[i];
mz:=m;
end;
end;
write(mz);
write(max);
write(h);
end.