B1:
program ct;
uses crt;
var i,n,Max:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
Max:=A[1];
for i:=2 to n do
if Max<A[i] then Max:=A[i];
writeln('gia tri lon nhat la:',Max);
readln
end.
B2:
program ct;
uses crt;
var i,n,Min:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
Min:=A[1];
for i:=2 to n do
if Min>A[i] then Min:=A[i];
writeln('gia tri nho nhat la:',Min);
readln
end.
B3:
program ct;
uses crt;
var i,n,S:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
S:=0;
for i:=1 to n do S:=S+A[i];
writeln('tong cac so trong day la:',S);
readln
end.
B4:
program ct;
uses crt;
var i,n,S:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
S:=0;
for i:=1 to n do
if A[i] mod 2=1 then S:=S+A[i];
writeln('tong so le la:',S);
readln
end.
B5:
program ct;
uses crt;
var i,n,S:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
S:=0;
for i:=1 to n do
if A[i] mod 2=0 then S:=S+A[i];
writeln('tong so chan la:',S);
readln
end.