const
a=5
x=record;
name1:array[1..a] of string;
number:array[1..a] of string;
cj1,cj2,cj3,cj4:array[1..a] of real;
end;
var
n,e:integer;
b:integer;
s:array[1..a] of real;
pj:array[1..a] of real;
i,j:integer;
zz:array[1..7,1..5] of real;
f:integer;
begin
for b:=1 to 5 do
readln((x.name1[b]),(x.number[b]),(x.cj1[b]),(x.cj2[b]),(x.cj3[b]),(x.cj4[b]));
s[a]:=(x.cj1[b])+(x.cj2[b])+(x.cj3[b])+(x.cj4[b]);
pj:=s[a]/4;
for n:=1 to a do
for e:1 to a-1 do
with x do
if s[e] <s[e+1] then
begin
f:=s[e];
s[e]:=s[e+1];
s[e+1]:=f;
end;
for i:=1 to 7 do
begin
for j:=1 to 5 do
begin
with x do
zz[1,j]:=name;
zz[2,j]:=(cj1[b]);
zz[3,j]:=(cj2[b]);
zz[4,j]:=(cj3[b]);
zz[5,j]:=(cj4[b]);
zz[6,j]:=(zf[b]);
zz[7,j]:=(pj(b));
end;
write(zz[i,j]);
end;
end.
1、利用记录,输入四个姓名,性别,语文、数学、英语、物理的成绩,计算每个人的总分,平均分。最后按照总分从高到低的顺序打印输出所有人的信息。
[有两个错待改--]
@朱智语