Câu 1:
uses crt;
var st1,st2,st3:string;
ln,d1,d2,d3:integer;
begin
clrscr;
write('Nhap ho ten thu 1:'); readln(st1);
write('Nhap ho ten thu 2:'); readln(st2);
write('Nhap ho ten thu 3:'); readln(st3);
d1:=length(st1);
d2:=length(st2);
d3:=length(st3);
ln:=0;
if ln<d1 then ln:=d1;
if ln<d2 then ln:=d2;
if ln<d3 then ln:=d3;
if ln=d1 then writeln(st1);
if ln=d2 then writeln(st2);
if ln=d3 then writeln(st3);
readln;
end.
Câu 2: Sửa đề: N<=150
uses crt;
var a:array[1..150]of integer;
i,n,k,dem:integer;
begin
clrscr;
repeat
write('nhap n='); readln(n);
until (0<n) and (n<=150);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
dem:=0;
for i:=1 to n do
if k mod a[i]=0 then inc(dem);
writeln('So uoc cua ',k,' trong day la: ',dem);
readln;
end.