- 谁拿了最多奖学金
- 2009-01-29 14:08:36 @
var aa:array[1..100] of longint;
s:ansistring;
bb:array[1..100] of string;
b,c,f,i,n,o,l,k,j:integer;
d,e:char;
x,y:longint;
begin
readln(n);
for i:=1 to n do
begin
b:=0;c:=0;f:=0;o:=1;
readln(s);
l:=length(s);
for j:=1 to l do
if (s[j]' ') then bb[i]:=bb[i]+s[j]
else break;
for k:=j+1 to l do
if (s[k]' ') then begin
b:=o*b+ord(s[k])-ord('0');
o:=o*10;
end
else break;
o:=1;
for j:=k+1 to l do
if (s[j]' ') then begin
c:=o*c+ord(s[j])-ord('0');
o:=o*10;
end
else break;
for k:=j+1 to l do
if (s[k]' ') then d:=s[k]
else break;
for j:=k+1 to l do
if (s[j]' ') then e:=s[j]
else break;
o:=1;
for k:=j+1 to l do
if (s[k]' ') then begin
f:=f*o+ord(s[k])-ord('0');
o:=o*10;
end
else break;
aa[i]:=0;
if (b>80) and (f>=1) then aa[i]:=aa[i]+8000;
if (b>85) and (c>80) then aa[i]:=aa[i]+4000;
if (b>90) then aa[i]:=aa[i]+2000;
if (b>85) and (e='Y') then aa[i]:=aa[i]+1000;
if (b>80) and (d='Y') then aa[i]:=aa[i]+850;
end;
x:=aa[1];y:=aa[1];
for i:=2 to n do
begin
if (aa[i]>=x) then x:=aa[i];
y:=y+aa[i];
end;
for i:=1 to n do
if (aa[i]=x) then break;
writeln(bb[i]);
writeln(aa[i]);
writeln(y);
end.
1 条评论
-
梦想实现家 LV 8 @ 2009-05-29 14:46:09
5怎么了??
- 1