- 谁拿了最多奖学金
- 2010-04-05 10:47:46 @
程序:
var
s,max,n,i,r:integer;
a,b:0..100;
c:0..10;
mn,nam:string[20]; w,x:char;
begin
readln(n);
for i:=1 to n do
begin
read(nam,a,b,w,x,c);
r:=0;
if (a>80) and (c>=1) then r:=r+8000;
if (a>85) and (b>80) then r:=r+4000;
if (a>90) then r:=r+2000;
if (a>85) and (x='Y') then r:=r+1000;
if (b>80) and (w='Y') then r:=r+850;
if r>max then begin max:=r; mn:=nam; end;
s:=s+r;
end;
writeln(mn);
writeln(max);
writeln(s);
end.
1 条评论
-
weizhanjun LV 5 @ 2013-10-27 12:49:08
这样读入根本不对read(name) 后 YaoLin 87 82 Y N 0 整个都会被读入也就是name 为 YaoLin 87 82 Y N 0 而不是 YaoLin
- 1