- 谁拿了最多奖学金
- 2009-09-13 16:34:32 @
type
student=record
name:string[16];
score1:integer;
score2:integer;
ganbu:char;
xibu:char;
lunwen:1..10;
money:longint;
end;
var
stu:array[1..100] of student;
temp:student;
i,n,mo:integer;
ch:char;
begin
readln(n);
for i:=1 to n do
with stu[i] do
begin
read(ch);
while ch' ' do
begin
name:=name+ch;
read(ch);
end;
read(score1);
read(score2);
read(ganbu,ganbu);
read(xibu,xibu);
readln(lunwen);
end;
for i:=1 to n do
begin
if (stu[i].score1>90) then stu[i].money:=stu[i].money+2000;
if (stu[i].score1>80)and(stu[i].lunwen>=1)then stu[i].money:=stu[i].money+8000;
if (stu[i].score1>85)and(stu[i].score2>=80)then stu[i].money:=stu[i].money+4000;
if (stu[i].score1>85)and(stu[i].xibu='Y')then stu[i].money:=stu[i].money+1000;
if (stu[i].score2>80)and(stu[i].ganbu='Y')then stu[i].money:=stu[i].money+850;
end;
for i:=1 to n do
if stu[i].money>temp.money then temp:=stu[i];
writeln(temp.name);
writeln(temp.money);
for i:=1 to n do
with stu[i] do
mo:=money+mo;
write(mo);
end.