- 谁拿了最多奖学金
- 2012-07-21 18:08:08 @
program p1001;
type
rec=record
nam:string;
avr:integer;
cla:integer;
sth:char;
gan:char;
lun:integer;
tot:longint;
end;
var n,i,t,k:integer;
a:array[1..100] of rec;
c,d,e:char;
tot:longint;
begin
readln(n);
for i:=1 to n do
begin
repeat
read(c);
a[i].nam:=a[i].nam+c;
until c=' ';
read(a[i].avr,a[i].cla);
read(d,a[i].gan,e,a[i].sth);
read(a[i].lun);
end;
for i:=1 to n do
if (a[i].avr>80) and (a[i].lun>0) then inc(a[i].tot,8000);
for i:=1 to n do
if (a[i].avr>85) and (a[i].cla>80) then inc(a[i].tot,4000);
for i:=1 to n do
if (a[i].avr>90) then inc(a[i].tot,2000);
for i:=1 to n do
if (a[i].avr>85) and (a[i].sth='Y') then inc(a[i].tot,1000);
for i:=1 to n do
if (a[i].cla>80) and (a[i].gan='Y') then inc(a[i].tot,850);
for i:=1 to n do
begin
inc(tot,a[i].tot);
if (a[i].tot>t) then begin t:=a[i].tot; k:=i;end;
end;
writeln(a[k].nam);
writeln(a[k].tot);
writeln(tot);
end.
莫名其妙的读入错误……莫名其妙的AC……