- 谁拿了最多奖学金
- 2012-07-14 10:21:13 @
var
gb,xb:array[1..100] of char;
qm,bj,lw,JJ:array [1..100] of longint;
n,i,sum,max,best,j:longint;
xm:array[1..100] of string;
ch:char;
begin
readln(n);
for i:=1 to n do
begin
while ch ' ' do begin
read(ch); xm[i]:=xm[i]+ch;
end;
readln(qm[i],bj[i],gb[i],xb[i],lw[i]);
end;
for i:=1 to n do begin
if (qm[i]>80) and (lw[i]>=1) then jj[i]:=jj[i]+8000;
if (qm[i]>85) and (bj[i]>80) then jj[i]:=jj[i]+4000;
if qm[i]>90 then jj[i]:=jj[i]+2000;
if (qm[i]>85) and (xb[i]='Y') then jj[i]:=jj[i]+1000;
if (bj[i]>80) and (gb[i]='Y') then jj[i]:=jj[i]+850;
if jj[i]> max then begin
max:=jj[i]; best:=i;
end;
sum:=sum+jj[i];
end;
writeln(xm[best]);
writeln(max);
writeln(sum);
for j:=1 to n do write(xm[i]);
end.
1 条评论
-
Caption.lei LV 6 @ 2012-08-10 15:59:45
注意样例中
YaoLin 87 82 Y N 0
82与Y,Y与N之间的空格
空格也被程序当做字符处理
- 1