

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
do ko ghi nnlt nên mình làm pascal mà chắc cái này ko phải pascal đâu python hay C++ j đấy nhưng mà chán quá nên mần :)))
====================================
uses crt;
var s,s1,s2:string;
i,j:byte;
function xoa1(s:string):string;
begin
while pos(#32,s)<>0 do
delete(s,pos(#32,s),1);
exit(s);
end;
function xoa(s:string):string;
var i,j:byte;
begin
i:=1;
//neu ko tinh ky tu trang thi xoa dau // o duoi la dc
s:=xoa1(s);
while i<=length(s) do
begin
for j:=i+1 to length(s) do
if s[i]=s[j] then delete(s,j,1);
i:=i+1;
end;
exit(s);
end;
begin
clrscr;
assign(input,'BAI1.inp');
reset(input);
assign(output,'BAI1.,out');
rewrite(output);
readln(s);
readln(s1);
s:=xoa(s);
s1:=xoa(s1);
for i:=1 to length(s) do
if pos(s[i],s1)<>0 then
s2:=s2+s[i];
write(s2);
close(output);
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin