Bài 1:
uses crt;
var i,n,s:longint; a:array[1..1000000]of longint;
begin
clrscr;
write('Nhap do dai cua day: ');readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': ');readln(a[i]);
inc(s,a[i]);
end;
writeln('Tong cac so trong mang: ',s);
writeln('Trung binh cong cac so trong mang: ',s/n:0:2);
readln
end.
Bài 2:
uses crt;
var f:text; n,m:longint;
begin
clrscr;
assign(f,'Baitap3.txt');reset(f);
readln(f,n,m);
if n>m then writeln(n,' la so lon hon') else
if m>n then writeln(m,' la so lon hon') else
writeln('Khong co so lon hon');
close(f);
end.