level 1
khd01670
楼主
program p1002;
type shuju=record
xm:string[20];
qm:integer;
bj:integer;
gb:char;
xb:char;
lw:integer;
jj:integer;
end;
shujug=array[1..100] of shuju;
var a,b:shujug;
i,n,zong,max:integer;
procedure shuru(var c:shujug);
var n:integer;
begin
read(c[i].xm);read(c[i].qm);read(c[i].bj);read(c[i].gb);read(c[i].xb);readln(c[i].lw);
end;
procedure ys(var c:shujug);
begin
if (c[i].qm>80) and (c[i].lw>=1) then c[i].jj:=c[i].jj+8000;
end;
procedure ws(var c:shujug);
begin
if (c[i].qm>85) and (c[i].bj>80) then c[i].jj:=c[i].jj+4000;
end;
procedure yx(var c:shujug);
begin
if c[i].qm>90 then c[i].jj:=c[i].jj+2000;
end;
procedure xbj(var c:shujug);
begin
if (c[i].qm>85) and (c[i].xb='Y') then c[i].jj:=c[i].jj+1000;
end;
procedure bjg(var c:shujug);
begin
if (c[i].bj>80) and (c[i].gb='Y') then c[i].jj:= c[i].jj+850;
end;
begin
max:=0;
zong:=0;
readln(n);
for i:=1 to n do
shuru(a);
for i:=1 to n do
begin
ys(a);
ws(a);
yx(a);
xbj(a);
bjg(a);
zong:=zong+a[i].jj;
if a[i].jj>max then
begin
max:=a[i].jj;
b[1]:=a[i];
end;
end;
writeln(b[1].xm);
writeln(b[1].jj);
writeln(zong);
end.
错误的程序如上
2010年05月29日 15点05分
1
type shuju=record
xm:string[20];
qm:integer;
bj:integer;
gb:char;
xb:char;
lw:integer;
jj:integer;
end;
shujug=array[1..100] of shuju;
var a,b:shujug;
i,n,zong,max:integer;
procedure shuru(var c:shujug);
var n:integer;
begin
read(c[i].xm);read(c[i].qm);read(c[i].bj);read(c[i].gb);read(c[i].xb);readln(c[i].lw);
end;
procedure ys(var c:shujug);
begin
if (c[i].qm>80) and (c[i].lw>=1) then c[i].jj:=c[i].jj+8000;
end;
procedure ws(var c:shujug);
begin
if (c[i].qm>85) and (c[i].bj>80) then c[i].jj:=c[i].jj+4000;
end;
procedure yx(var c:shujug);
begin
if c[i].qm>90 then c[i].jj:=c[i].jj+2000;
end;
procedure xbj(var c:shujug);
begin
if (c[i].qm>85) and (c[i].xb='Y') then c[i].jj:=c[i].jj+1000;
end;
procedure bjg(var c:shujug);
begin
if (c[i].bj>80) and (c[i].gb='Y') then c[i].jj:= c[i].jj+850;
end;
begin
max:=0;
zong:=0;
readln(n);
for i:=1 to n do
shuru(a);
for i:=1 to n do
begin
ys(a);
ws(a);
yx(a);
xbj(a);
bjg(a);
zong:=zong+a[i].jj;
if a[i].jj>max then
begin
max:=a[i].jj;
b[1]:=a[i];
end;
end;
writeln(b[1].xm);
writeln(b[1].jj);
writeln(zong);
end.
错误的程序如上