- 谁拿了最多奖学金
- 2009-07-17 21:15:40 @
编译通过...
├ 测试数据 01:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 02:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 03:答案错误...程序输出比正确答案长
├ 测试数据 04:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 05:答案错误...程序输出比正确答案长
├ 测试数据 06:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 07:答案错误...程序输出比正确答案长
├ 测试数据 08:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 09:答案错误...程序输出比正确答案长
├ 测试数据 10:答案错误... ├ 标准行输出
├ 错误行输出
---|---|---|---|---|---|---|---|-
type stu=record
name:string;
qm,bj,lw:longint;
xs,xb:boolean;
end;
var total,n,i,maxn,max:longint;
s:string;
b:array[1..100] of longint;
a:array[1..100] of stu;
procedure dang(si:string;ii:longint);
var i,j,k:longint;ss:string;
begin
k:=length(si);
ss:='';
for j:=1 to k do if si[j]' 'then ss:=ss+si[j]
else begin
a[ii].name:=ss;
break;
end;
ss:='';
for i:=j+1 to k do if si[i]' 'then ss:=ss+si[i]
else begin
val(ss,a[ii].qm);
break;
end;
ss:='';
for j:=i+1 to k do if si[j]' 'then ss:=ss+si[i]
else begin
val(ss,a[ii].bj);
break;
end;
if si[j+1]='Y' then a[ii].xs:=true else a[ii].xs:=false;
if si[j+3]='Y' then a[ii].xb:=true else a[ii].xb:=false;
ss:='';
for i:=j+5 to k do if si[i]' ' then ss:=ss+si[i]
else break;
val(ss,a[ii].lw);
end;
begin
readln(n);
for i:=1 to n do
begin
readln(s);
dang(s,i);
end;
max:=0;maxn:=0;total:=0;
for i:=1 to n do
begin
b[i]:=0;
if (a[i].qm>80) and (a[i].lw>0) then b[i]:=b[i]+8000;
if (a[i].qm>85) and (a[i].bj>80) then b[i]:=b[i]+4000;
if (a[i].qm>90) then b[i]:=b[i]+2000;
if (a[i].qm>85) and a[i].xb then b[i]:=b[i]+1000;
if (a[i].bj>80) and a[i].xs then b[i]:=b[i]+850;
if b[i]>max then begin max:=b[i];maxn:=i; end;
total:=total+b[i];
end;
writeln(a[maxn].name);
writeln(b[maxn]);
write(total);
end.