1:
uses crt;
var st1,st2:string;
begin
clrscr;
write('Nhap xau thu nhat:'); readln(st1);
write('Nhap xau thu hai:'); readln(st2);
if length(st1)>length(st2) then writeln(st2)
else if length(st1)<length(st2) then writeln(st1)
else writeln('Hai xau co do dai bang nhau');
readln;
end.
2:
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if st[i]=' ' then inc(dem);
writeln('So luong dau cach trong xau ',st,' la: ',dem);
readln;
end.