- 谁拿了最多奖学金
- 2008-12-17 12:24:57 @
var n,i,j,t:integer;
max:int64;
st:string;
a:array[0..101] of string;
b:array[0..101] of integer;
procedure aa(st:string; i:integer);
var x,y,z,p,c,sum:integer;
st1,st2:char;
m:string;
begin
p:=pos(' ',st); m:=copy(st,1,p-1); delete(st,1,p); a[i]:=m;
p:=pos(' ',st); m:=copy(st,1,p-1); delete(st,1,p); val(m,x,c);
p:=pos(' ',st); m:=copy(st,1,p-1); delete(st,1,p); val(m,y,c);
st1:=st[1];
st2:=st[3];
delete(st,1,4);
val(st,z,c);
sum:=0;
if (x>80)and(z>0) then sum:=sum+8000;
if (x>85)and(y>80) then sum:=sum+4000;
if (x>90) then sum:=sum+2000;
if (x>85)and(st2='Y') then sum:=sum+1000;
if (x>80)and(st1='Y') then sum:=sum+850;
b[i]:=sum; max:=max+sum;
end;
begin
readln(n);
for i:=1 to n do
begin
readln(st);
aa(st,i);
end;
for i:=1 to n-1 do
for j:=n downto i+1 do
if (b[j]>b[j-1])or(b[j]=b[j-1])and(a[j]