Câu 1:
Program HOC24;
var a: array[1..10] of integer;
min,max,i: integer;
begin
for i:=1 to 10 do
begin
write('Nhap so thu ',i,' : '); readln(a[i]);
end;
min:=32000; max:=0;
for i:=1 to 10 do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('So lon nhat la :',max);
write('So nho nhat la : ',min);
readln
end.
Câu 2:
Program HOC24;
var a: array[1..20] of integer;
t,i: integer;
begin
for i:=1 to 20 do
begin
write('Nhap so thu ',i,' : '); readln(a[i]);
end;
t:=0;
for i:=1 to 20 do
if a[i] mod 2<>0 then t:=t+a[i];
writeln('Tong cac so le la :',t);
readln
end.