Pagini recente » Cod sursa (job #2761329) | Cod sursa (job #1399071) | Cod sursa (job #2720330) | Cod sursa (job #1394459) | Cod sursa (job #20957)
Cod sursa(job #20957)
Program perechi_cuv;
var f,g:text;
n,i,j,x,p:integer;
cuvinte:array[1..100] of string;
Begin
assign(f,'date.in');assign(g,'date.out');
reset(f);rewrite(g);
read(f,n);x:=0;
for i:=1 to n do readln(f,cuvinte[i]);
for i:=1 to n do begin
for j:=1 to n do begin
if not(i=j) then
p:=pos(cuvinte[i],cuvinte[j]);
if p<>0 then begin
writeLN(g,cuvinte[i],' ',cuvinte[j]);
x:=x+1;end;end;
end;
if x=0 then write(g,'Nu exista solutii');
close(f);close(g);
end.