Câu 1:
uses crt;
var a:array[1..100]of real;
n,i:integer;
tbc:real;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
tbc:=0;
for i:=1 to n do
tbc:=tbc+a[i];
writeln('Trung binh cong cua day so la: ',tbc/n:4:2);
readln;
end.
Câu 2:
uses crt;
var a:array[1..100]of integer;
n,i,max:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.