- 谁拿了最多奖学金
- 2009-11-03 23:08:45 @
var
name,nn:array[1..30]of char;
max,sum,x,y,u,m1,m2,n,i,j:longint;
ch,b1,b2:char;
begin
readln(n);
max:=0;
sum:=0;
fillchar(name,sizeof(name),' ');
for i:=1 to n do
begin
fillchar(nn,sizeof(nn),' ');
j:=0;
repeat
read(ch);
if ch=' ' then break;
inc(j);
nn[j]:=ch;
until false;
read(m1,m2);
repeat read(b1) until (b1='Y') or (b1='N');
repeat read(b2) until (b2='Y') or (b2='N');
readln(u);
x:=0;
if (m1>80) and (u>0) then x:=x+8000;
if (m1>85) and (m2>80) then x:=x+4000;
if (m1>90) then x:=x+2000;
if (m1>85) and (b2='Y') then x:=x+1000;
if (m1>80) and (b1='Y') then x:=x+850;
sum:=sum+x;
if x>max then begin
max:=x;
name:=nn;
end;
end;
j:=1;
repeat
write(name[j]);
inc(j);
until name[j]=' ';
writeln;
writeln(max);
writeln(sum);
end.
1 条评论
-
yuu_we LV 8 @ 2009-11-03 23:47:37
呵呵……和我一样
判断的最后一行是m2>80,不是m1。。
好阴的陷阱。。。
- 1