uses crt;
var i,j:byte;
a: array [1..4,0..11] of real;
begin
for j:=1 to 4 do
begin
for i:=1 to 10 do
begin
write('Diem cua nguoi ',i,' to ',j,': );readln(a[j,i]);
a[j,11]:=a[j,11]+a[j,i]/10;
end;
for i:=1 to 4 do if a[i,11]> a[j,11] then inc(a[j,0]);
end;
for j:=1 to 4 do
writeln('Diem TB to ',j,' :',a[j,11]:0:2,', xep thu ',a[j,0]:0:0);
readln;
end.
uses crt; var i,j:byte; a: array [1..4,0..11] of real; begin for j:=1 to 4 do begin for i:=1 to 10 do begin write('Diem cua nguoi ',i,' to ',j,': );readln(a[j,i]); a[j,11]:=a[j,11]+a[j,i]/10; end; for i:=1 to 4 do if a[i,11]> a[j,11] then inc(a[j,0]); end; for j:=1 to 4 do writeln('Diem TB to ',j,' :',a[j,11]:0:2,', xep thu ',a[j,0]:0:0); readln; end.
uses crt;
var i,j:byte;
a, b ,c , d ,k: real;
begin
for j:=1 to 40 do
begin
readln(k);
if j<11 then a:=a+k else if j<21 then b:=b+k else if j<31 then c:=c+k else d=d+k; end;
uses crt;
var i,j:byte;
a: array [1..4,0..11] of real;
begin
for j:=1 to 4 do
begin
for i:=1 to 10 do
begin
write('Diem cua nguoi ',i,' to ',j,': );readln(a[j,i]);
a[j,11]:=a[j,11]+a[j,i]/10;
end;
for i:=1 to 4 do if a[i,11]> a[j,11] then inc(a[j,0]);
end;
for j:=1 to 4 do
writeln('Diem TB to ',j,' :',a[j,11]:0:2,', xep thu ',a[j,0]:0:0);
readln;
end.
program bai_tap;
uses crt;
var tong,tmp:real;
a:array[1..4]of real;
i:byte;
begin
tong:=0
for i:=1 to 40 do
begin
write('nhap diem nguoi thu ',i mod 10,' to ',i div 10+1,':');readln(tmp);
tong:=tong+tmp;
if i mod 10=0 then
begin
a[i div 10+1]:=tong/10;
tong:=0;
end;
end;
for i:=1 to 4 do write(' diem to ',i,'la: ',a:1:3);
readln;
end.